<?php
namespace app\controller;

use app\BaseController;
use app\model\ElevatorNdata;
use app\model\TowerCraneNdata;
use GuzzleHttp\Client;
use PhpAmqpLib\Connection\AMQPStreamConnection;
use PhpAmqpLib\Message\AMQPMessage;
use think\facade\Cache;
use think\facade\Db;
use think\facade\Log;
use think\Request;

/* 转发 */
class ForwardController extends BaseController
{
    public static function forward($param)
    {
        switch ($param['forward_id']) {
            case 1001:
                //塔机转老平台数据
                /*
                "eid": 15663,
                "height": 0, //高度
                "range": 0, //幅度
                "rotation_angle": 0, //回转角度
                "lifting_weight": 0, //吊重
                "force": 0, //力距
                "force_distance": 0, //力距百分比
                "wind_speed": 0, //风速
                "magnification": "本机倍率2倍率", //倍率
                "anteversion_x": 0, //倾角X
                "anteversion_y": 0
                 */
                $url = '118.190.60.2/api/v1/hardware/TowerRealData';
                $send = [
                    "eid" => $param['eid'],
                    "height" => $param['height'],
                    "lifting_weight" => $param['weight'],
                    "rotation_angle" => $param['round'],
                    "range" => $param['amplitude'],
                    "wind_speed" => $param['wind_speed'],
                    "force" => $param['moment'],
                    "force_distance" => $param['moment_percent'],
                    "anteversion_x" => $param['angle_x'],
                    "anteversion_y" => $param['angle_y'],
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 1002:
                //塔机转盘石
                /*
                "eid": 15663,
                "height": 0, //高度
                "range": 0, //幅度
                "rotation_angle": 0, //回转角度
                "lifting_weight": 0, //吊重
                "force": 0, //力距
                "force_distance": 0, //力距百分比
                "wind_speed": 0, //风速
                "magnification": "本机倍率2倍率", //倍率
                "anteversion_x": 0, //倾角X
                "anteversion_y": 0
                 */
                $url = 'http://panshelec.cn/api/v1/hardware/TowerRealData';
                $send = [
                    "eid" => $param['eid'],
                    "height" => $param['height'],
                    "lifting_weight" => $param['weight'],
                    "rotation_angle" => $param['round'],
                    "range" => $param['amplitude'],
                    "wind_speed" => $param['wind_speed'],
                    "force" => $param['moment'],
                    "force_distance" => $param['moment_percent'],
                    "anteversion_x" => $param['angle_x'],
                    "anteversion_y" => $param['angle_y'],
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 2001:
                case2001:
                //升降机转老平台数据
                $url = '118.190.60.2/api/v1/hardware/addElevatorHistorical';
                $send = [
                    "eid" => $param['eid'],
                    "height" => $param['height'],
                    "weight" => $param['weight'],
                    "number" => $param['number'],
                    "speed" => $param['speed'],
                    "wind_speed" => $param['wind_speed'],
                    "load" => $param['elevator_load'],
                    "tilt_x" => $param['tilt_x'],
                    "tilt_y" => $param['tilt_y'],
                    "front_door_status" => $param['front_door_status'],
                    "rear_door_status" => $param['back_door_status'],
                    "run_status" => $param['run_status'],
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 2002:
                //升降机转panshi数据
                $url = 'http://panshelec.cn/api/v1/hardware/addElevatorHistorical';
                $send = [
                    "eid" => $param['eid'],
                    "height" => $param['height'],
                    "weight" => $param['weight'],
                    "number" => $param['number'],
                    "speed" => $param['speed'],
                    "wind_speed" => $param['wind_speed'],
                    "load" => $param['elevator_load'],
                    "tilt_x" => $param['tilt_x'],
                    "tilt_y" => $param['tilt_y'],
                    "front_door_status" => $param['front_door_status'],
                    "rear_door_status" => $param['back_door_status'],
                    "run_status" => $param['run_status'],
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 3000:
                //湖南建研 云南-山东探越
                $url = 'http://14.205.92.158:8086/CraneOpenApi/TowerOpen/RealData';
                $ts = time() * 1000;
                $appid = 'D9D6AAFA-3066-1CCA-C957-53D69D491356';
                $appkey = 'EAC1863FBF1FEC83C22DD2963E369C0A';
                $token = md5($appid . $ts . $appkey);
                // $method = 'AES-128-ECB';
                // $key = 'epointforward@!1';
                // $AppSecret = openssl_encrypt($aes_data, $method, $key);
                $send['Data'][0] = [
                    "Deviceid" => "TD001",
                    "Datatime" => date('Y-m-d', time()) . 'T' . date('H:i:s', time()),
                    "Height" => 70,
                    "HeightStatus" => 0,
                    "Range" => 50,
                    "RangeStatus" => 0,
                    "Angle" => 180,
                    "AngleStatus" => 0,
                    "Load" => 45,
                    "LoadStatus" => 0,
                    "Obliquity1" => 14,
                    "ObliquityStatus1" => 0,
                    "Obliquity2" => 11,
                    "ObliquityStatus2" => 0,
                    "WindSpeed" => 4.6,
                    "Wind" => 3,
                    "Overload" => 34,
                    "Moment" => 56,
                    "Temperature" => 270,
                    "BoltCount" => 0,
                    "RopeData" => "1,150,200",
                    "Collision" => 0,
                    "DataId" => (string) time(),
                ];
                $send_json = json_encode($send);
                $headers = [
                    'appid' => $appid,
                    'ts' => $ts,
                    'token' => $token,
                ];
                $client = new Client;
                Log::write($headers, 'ForwardController3000');
                Log::write($send_json, 'ForwardController3000');
                $response = $client->request('POST', $url, [
                    'json' => $send,
                    'headers' => $headers,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($stringBody, 'ForwardController3000');
                break;
            case 201:
                //李珊珊-彭总-云筑-升降机
                $eid = $param['eid'];
                $url = 'https://ibuildapi.yzw.cn/open.api';
                $app_ID = 'SP.95784dc6678144469b62ca1cf469b584';
                $app_SECRET = '5abe2790b6eb47cdb8c94ba9608d5027';
                /*
                bit0    风速报警
                bit1    超重报警
                bit2    碰撞报警
                bit3    力矩报警
                bit4    倾斜报警
                DB::table('tower_crane_rdata')->select();
                 */
                $type_id = DB::table('elevator_alarm_ndata')->where('eid', $param['eid'])->value('type_id');
                $type_ids = [0, 8, 40, 99, 7, 52];
                $alarm_data = [
                    '0' => '00000000000000000000000000000000',
                    '8' => '00000000000000000000000000000001',
                    '40' => '00000000000000000000000000000010',
                    '99' => '00000000000000000000000000000100',
                    '7' => '00000000000000000000000000001000',
                    '52' => '00000000000000000000000000010000',
                ];
                if ($type_id && in_array($type_id, $type_ids)) {
                    $warning = $alarm_data[$type_id];
                } else {
                    $warning = $alarm_data['0'];
                }
                /*
                currentLoad    double    是    载重，单位：吨，支持2位小数
                currentRatedLoad    double    是    当前额定载荷，单位：吨，支持2位小数
                loadPercent    double    是    载重百分比，单位：%，支持2位小数
                personCount    integer    否    人数
                floor    integer    否    楼层
                speed    double    否    速度，单位：米每秒，支持2位小数
                windSpeed    double    否    风速，单位：米每秒，支持2位小数
                height    double    是    高度，单位：米，支持2位小数
                driverId    string    否    驾驶员身份证号
                driverName    string    否    驾驶员姓名
                windScale    integer    否    风力等级
                dipAngleX    double    否    倾角x，单位：度，支持2位小数
                dipAngleY    double    否    倾角y，单位：度，支持2位小数

                 */
                $send_data = [
                    "deviceId" => $param['eid'],
                    "deviceTime" => date('Y-m-d H:i:s', time()),
                    "warning" => $warning,
                    "currentLoad" => round($param['weight'] / 1000, 2),
                    "loadPercent" => round($param['weight'] / 100000, 2),
                    "currentRatedLoad" => 50,
                    "personCount" => $param['number'],
                    "floor" => 0,
                    "speed" => $param['speed'],
                    "windSpeed" => $param['wind_speed'],
                    "height" => $param['height'],
                    "dipAngleX" => $param['tilt_x'], //anteversion_x
                    "dipAngleY" => $param['tilt_y'], //anteversion_y
                ];
                $send_data = json_encode($send_data);
                $str = "1234567890asdfghjklqwertyuiopzxcvbnmASDFGHJKLZXCVBNMPOIUYTREWQ";
                $nonce = substr(str_shuffle($str), 0, 32);
                $send = [
                    "appid" => $app_ID,
                    "format" => "json",
                    "method" => "upload.constructionElevatorLiveData",
                    "nonce" => $nonce,
                    "timestamp" => date('YmdHis', time()),
                    "version" => "1.0",
                    "data" => $send_data,
                ];
                ksort($send, 0);
                $buff = "";
                foreach ($send as $k => $v) {
                    $buff .= $k . "=" . $v . "&";
                }
                $string = trim($buff, "&");
                $string = $string . "&appsecret=" . $app_SECRET;
                $string = strtolower($string);
                $string = md5($string);
                $send["sign"] = $string;
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'form_params' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($stringBody, 'ForwardController');
                return 1;
                break;
            case 202:
                //小张客户-升降机-儒安
                $url = 'http://112.25.253.174:19999/device/deviceDataUpload/upload';
                $data['eid'] = $param['eid'];
                $data['height'] = $param['height'];
                $data['speed'] = $param['speed'];
                $data['weight'] = $param['weight'];
                $data['load'] = $param['elevator_load'];
                $data['tilt_x'] = $param['tilt_x'];
                $data['tilt_y'] = $param['tilt_y'];
                $data['front_door_status'] = $param['front_door_status'];
                $data['rear_door_status'] = $param['back_door_status'];
                $data['run_status'] = $param['run_status'];
                $data['wind_speed'] = $param['wind_speed'];
                $data['number'] = $param['number'];
                $data['updated_at'] = date('Y-m-d H:i:s', time());
                $send_data = [
                    "deviceType" => "2",
                    "messageType" => "5",
                    "message" => $data,
                ];

                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send_data,
                ])->getBody();
                $stringBody = (string) $response;

                return 1;
                break;
            case 205:
                //赵磊-升降机-沈阳
                $url = 'https://scs.crland.com.cn/smart-api/v1/lift/saveRealtimeRecord';
                $app_ID = 'hr1636092853856';
                $app_SECRET = '69493AC120CF070193D9A5CD0F7B9F3C';
                $orgId = '1453242068083281920';
                /*
                "orgId":"1453242068083281920"
                "name":"九悦"
                "appId":"hr1636092853856"
                "appSecret":"69493AC120CF070193D9A5CD0F7B9F3C"
                 */
                /*
                orgId：1519579500428529664
                name：大连公元九里
                appId：hr1652939523699
                appSecret：D7B23DCB8CE6FD0454A7510C03470A05
                 */
                /*
                orgId：1460851664717221888
                name：沈阳荣华府二期项目
                appId：hr1637146549011
                appSecret：74DB449E3EB89DAE455344925EFCC75
                 */
                if ($param['eid'] == 22040008) {
                    $app_ID = 'hr1652939523699';
                    $app_SECRET = 'D7B23DCB8CE6FD0454A7510C03470A05';
                    $orgId = '1519579500428529664';
                }

                if (in_array($param['eid'], [22110076, 22110075, 22110072, 22110073])) {
                    $app_ID = 'hr1637146549011';
                    $app_SECRET = '74DB449E3EB89DAE455344925EFCC75';
                    $orgId = '1460851664717221888';
                }
                if ($param['eid'] == 22110076) {
                    $array_rands = [22110073, 22110076];
                    $array_rand = array_rand($array_rands);
                    $param['eid'] = $array_rands[$array_rand];
                }
                $dataArr = [
                    'hardwareId' => (int) $param['eid'],
                    'datetime' => date('Y-m-d H:i:s', time()),
                    'load' => $param['weight'],
                    'dipAngle' => $param['tilt_x'],
                    'height' => $param['height'],
                    'windScale' => 1,
                    'windSpeed' => $param['wind_speed'],
                ];
                // Log::write($dataArr, 'ForwardController_205');
                $dataJson = json_encode($dataArr);
                $timestamp = time() * 1000;
                $send = [
                    "appId" => $app_ID,
                    "version" => "v1",
                    "method" => "lift",
                    "timestamp" => $timestamp,
                    "data" => $dataJson,
                ];
                // ksort($send, 0);
                $buff = "";
                foreach ($send as $k => $v) {
                    $buff .= $k . "=" . $v . "&";
                }
                $string = trim($buff, "&");
                $string = $app_SECRET . $string . $app_SECRET;
                // $string = strtolower($string);
                $sign = sha1($string);
                $send["sign"] = $sign;
                $send["appSecret"] = $app_SECRET;
                // $send["data"] = $dataArr;
                $url = $url . "?&appId=" . $app_ID . "&version=v1" . "&method=lift" . "&timestamp=" . $timestamp . "&sign=" . $sign;
                $sendData['body'] = $dataArr;
                // $response = Http::post($url, $dataArr)->body();
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $dataArr,
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($stringBody, 'ForwardController_205');
                return 1;
                break;
            case 206:
                // 湖北升思科技股份有限公司--李珊珊
                /* addresses: :
                username:
                password:
                virtual-host:
                publisher-confirms: true
                publisher-returns: true */
                // $conf = [
                //     'host' => '36.148.23.13',
                //     'port' => 5672,
                //     'user' => 'external',
                //     'pwd' => '72fs32d',
                //     'vhost' => '/',
                // ];
                $conf = [
                    'host' => '219.139.130.110',
                    'port' => 5674,
                    'user' => 'qzsb0001',
                    'pwd' => 'Qzsb@)!(321',
                    'vhost' => '/qzsb',
                ];
                // $vcode = '3e77b6dc47c94761921ffc7669eb4512,37212115256a6ccdcc5cc4094b9f0dc7,3bb2cf59f26343a89bb8596f07535e53';
                $vcode = $param['other'];
                /*
                5 额定重量(15.00)
                6 实际重量(12.35) $param['weight'];
                7 力 矩(145.63) $param['moment'];
                8 力矩百分比(98.32) $param['moment'];
                9 小车幅度(13.25) $param['amplitude'];
                10 吊钩高度(接近地面高度为 0，吊钩完全收起则为最大高度) $param['height'];
                11 回转角度(126.32) $param['round'];
                12 风速级别(6.32) $param['wind_speed'];
                13 塔臂倾角(+12.5) $param['angle_x'];
                 */
                $routingKey = 'QZSB-INTERFACE'; //路由关键字(也可以省略)
                $conn = new AMQPStreamConnection( //建立生产者与mq之间的连接
                    $conf['host'], $conf['port'], $conf['user'], $conf['pwd'], $conf['vhost']
                );
                $channel = $conn->channel(); //在已连接基础上建立生产者与mq之间的通道
                $msgBody = json_encode(["data" => "00001," . $param['eid'] . "," . $param['eid'] . ",,2,15," . $param['weight'] . "," . $param['moment'] . "," . $param['moment'] . "," . $param['amplitude'] . "," . $param['height'] . "," . $param['round'] . "," . $param['wind_speed'] . "," . $param['angle_x'] . ",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,," . $vcode, "author" => "WT", "tag" => "DATA"]);
                // Log::write($msgBody, 'ForwardController_206');
                $msg = new AMQPMessage($msgBody, ['content_type' => 'text/plain', 'content-encoding' => 'utf-8', 'publisher-confirms' => true, 'publisher-returns' => true, 'template' => ['mandatory' => true]]); //生成消息
                $r = $channel->basic_publish($msg, '', $routingKey); //推送消息到某个交换机
                $channel->close();
                $conn->close();
                break;
            case 2061:
                // 湖北升思科技股份有限公司--李珊珊(荆州)
                /*
                addresses: :5672
                username: external
                password:
                 */
                $conf = [
                    'host' => '122.189.98.178',
                    'port' => 5672,
                    'user' => 'external',
                    'pwd' => '72fs32d',
                    'vhost' => '/',
                ];
                // $vcode = '3e77b6dc47c94761921ffc7669eb4512,37212115256a6ccdcc5cc4094b9f0dc7,3bb2cf59f26343a89bb8596f07535e53';
                $vcode = $param['other'];
                /*
                5 额定重量(15.00)
                6 实际重量(12.35) $param['weight'];
                7 力 矩(145.63) $param['moment'];
                8 力矩百分比(98.32) $param['moment'];
                9 小车幅度(13.25) $param['amplitude'];
                10 吊钩高度(接近地面高度为 0，吊钩完全收起则为最大高度) $param['height'];
                11 回转角度(126.32) $param['round'];
                12 风速级别(6.32) $param['wind_speed'];
                13 塔臂倾角(+12.5) $param['angle_x'];
                 */
                $routingKey = 'QZSB-INTERFACE'; //路由关键字(也可以省略)
                $conn = new AMQPStreamConnection( //建立生产者与mq之间的连接
                    $conf['host'], $conf['port'], $conf['user'], $conf['pwd'], $conf['vhost']
                );
                $channel = $conn->channel(); //在已连接基础上建立生产者与mq之间的通道
                $msgBody = json_encode(["data" => "00001," . $param['eid'] . "," . $param['eid'] . ",,2,15," . $param['weight'] . "," . $param['moment'] . "," . $param['moment'] . "," . $param['amplitude'] . "," . $param['height'] . "," . $param['round'] . "," . $param['wind_speed'] . "," . $param['angle_x'] . ",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,," . $vcode, "author" => "WT", "tag" => "DATA"]);
                Log::write($msgBody, 'ForwardController_2061');
                $msg = new AMQPMessage($msgBody, ['content_type' => 'text/plain', 'content-encoding' => 'utf-8', 'publisher-confirms' => true, 'publisher-returns' => true, 'template' => ['mandatory' => true]]); //生成消息
                $r = $channel->basic_publish($msg, '', $routingKey); //推送消息到某个交换机
                $channel->close();
                $conn->close();
                break;
            case 207:
                //小袁客户-升降机-源惠达
                /*
                {
                "name": "elevator_test1",
                "uploaddate": "2028-07-13 10:31:23",
                "weight": 0.737,
                "weightpercent": 36,
                "personnum": 4,
                "height": 4.6,
                "heightpercent": 3,
                "floor":2,
                "direction":1,
                "speed": 0.2,
                "tilt1": 0.56,
                "tiltpercent1": 0,
                "tilt2": 2.68,
                "tiltpercent2": 0,
                "authen": 0,
                "status_weigth": 3,
                "status_heigh": 3,
                "status_speed": 3,
                "status_pnumber": 3,
                "status_slant": 3,
                "foredoorstatus": 3,
                "behinddoorstatus":3,
                "lockstatus": 3,
                "status":"00000000"
                }
                 */
                // $url = 'http://221.178.232.138:33333/v1/dtsite/elevator1/demo001';
                // $url = 'http://106.14.195.74:8053/v2/iot/dtcloud/elevator1';
                $url = 'http://183.213.16.9:9002/iotZongyiyuan/v2/iot/dtcloud/elevator1';
                $data['name'] = (string) $param['eid'];
                $data['height'] = round($param['height'], 2);
                $data['speed'] = round($param['speed'], 2);
                $data['weight'] = round($param['weight'], 2);
                $data['weightpercent'] = round($param['elevator_load'], 2);
                $data['tilt1'] = round($param['tilt_x'], 2);
                $data['tilt2'] = round($param['tilt_y'], 2);
                $data['foredoorstatus'] = $param['front_door_status'];
                $data['behinddoorstatus'] = $param['back_door_status'];
                $data['direction'] = $param['run_status'];
                $data['wind_speed'] = round($param['wind_speed'], 2);
                $data['personnum'] = $param['number'];
                $data['floor'] = 0;
                $data['uploaddate'] = date('Y-m-d H:i:s', time());
                $json = json_encode($data);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $data,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 208:
                //联合&探越塔机技术对接群
                $url = 'http://sxiot.hnlhzw.cn:1884/ty/lift';
                if ($param['eid'] == 23110321) {
                    $url = '119.23.155.60:1884/ty/lift';
                }
                if ($param['eid'] == 23110388 || $param['eid'] == 23110369 || $param['eid'] == 23110386) {
                    $url = 'http://111.22.27.149:1884/ty/lift';
                }
                unset($param['forward_id'], $param['id'], $param['issued_control'], $param['create_time']);

                $client = new Client;
                $param['eid'] = (int) $param['eid'];
                $response = $client->request('POST', $url, [
                    'json' => $param,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($param, 'ForwardController_208');
                Log::write($stringBody, 'ForwardController_208');
                return 1;
                break;
            case 210:
                //探越&优建建筑对接群
                $url = 'https://zhgd.fjuj.com.cn/v1/iot/elevator4tanyue/elevatorRealData';
                unset($param['forward_id'], $param['id'], $param['issued_control'], $param['create_time']);
                $param['height'] = round($param['height'], 2);
                $param['weight'] = round($param['weight'], 2);
                $param['speed'] = round($param['speed'], 2);
                $param['wind_speed'] = round($param['wind_speed'], 2);
                $param['elevator_load'] = round($param['elevator_load'], 2);
                // Log::write($param, 'ForwardController_210');
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $param,
                ])->getBody();
                $stringBody = (string) $response;
                if ($param['eid'] == 22110077) {
                    goto case2001;
                }
                // Log::write($stringBody, 'ForwardController_210');
                return 1;
                break;
            case 209:
                //江苏安快智能-袁
                $url = 'http://123.60.57.233:8082/ayy/api/elevator';
                $send['deviceId'] = $param['eid'];
                $send['runStatus'] = $param['run_status'];
                $send['weight'] = $param['weight'];
                $send['height'] = $param['height'];
                $send['speed'] = $param['speed'];
                $send['windSpeed'] = $param['wind_speed'];
                $send['xinclination'] = $param['tilt_x'];
                $send['yinclination'] = $param['tilt_y'];
                $send['numberOfPeopleLoaded'] = $param['number'];
                $send['dipAngle'] = $param['tilt_x'];
                $send['singleDoorStatus'] = $param['front_door_status'];
                $send['doubleDoorStatus'] = $param['back_door_status'];
                $send['topDoorStatus'] = $param['top_door_status'];
                $send['sendTime'] = date('Y-m-d H:i:s', time());
                //-----未提供
                $send['idCard'] = '--';
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 211:
                //方介--袁
                $url = 'http://fj.fungee.cn//api/Cmsdata/record_elevator_realtime';
                $send['eid'] = $param['eid'];
                $send['weight'] = $param['weight'];
                $send['height'] = $param['height'];
                $send['speed'] = $param['speed'];
                $send['load'] = $param['elevator_load'];
                $send['tilt_x'] = $param['tilt_x'];
                $send['tilt_y'] = $param['tilt_y'];
                $send['front_door_status'] = $param['front_door_status'];
                $send['rear_door_status'] = $param['back_door_status'];
                $send['run_status'] = $param['run_status'];
                $send['wind_speed'] = $param['wind_speed'];
                $send['number'] = $param['number'];
                $send['created_at'] = date('Y-m-d H:i:s', time());
                //-----未提供
                $send['company_id'] = 1;
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 212:
                //中建五局烟台大学项目平台对接群"{"status":{"code":0,"text":"调用失败！realtimeFloor参数数字型格式传输错误，请检查！传输错误值：--"}}"
                $url = 'https://www.epointiot.com/IOTWebServiceAP/rest/elevatordataservice/pushRealTimeInfo';
                $send['params']['deviceSN'] = $param['eid'];
                $send['params']['deviceID'] = $param['eid'];
                $send['params']['deviceAuthCode'] = $param['eid'];
                $send['params']['monitorDateTime'] = date('Y-m-d H:i:s', time());
                $send['params']['name'] = '--';
                $send['params']['idNo'] = '--';
                $send['params']['realtimePeople'] = $param['number'];
                $send['params']['realtimeWeight'] = $param['weight'];
                $send['params']['realtimeHeight'] = $param['height'];
                $send['params']['realtimeSpeed'] = $param['speed'];
                $send['params']['realtimeFloor'] = 0;
                $send['params']['realtimeDipX'] = $param['tilt_x'];
                $send['params']['realtimeDipY'] = $param['tilt_y'];
                $send['params']['outDoorStatus'] = $param['front_door_status'];
                $send['params']['realtimeWindLevel'] = 0;
                $send['params']['realtimeWindSpeed'] = $param['wind_speed'];
                //-----未提供
                $send['params'] = json_encode($send['params']);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'form_params' => $send,
                ])->getBody();
                // $response = $client->request('POST', $url, [
                //     'multipart' => $send,
                // ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 213:
                //张姐-烟台客户-新点-升降机
                $url = 'http://zhgd.ytzjj.gov.cn/IOTWebService/rest/ElevatorDataService/PushRealTimeInfo';
                $Authorization = 'Bearer 1f7f736d9ead4f25ffb200438bff04a7';
                // $unifiedProjectCode = 'bd2a2a2d-c54e-4bdc-adbe-4ceeba0aab71';
                $unifiedProjectCode = '1c360be0-7c96-473d-8920-4d60a520151b';
                if ($param['eid'] == '22090046' || $param['eid'] == '22090037') {
                    $unifiedProjectCode = 'd08f6be2-66c3-48fe-b2c4-e7d74b5452f9';
                }
                /*  */
                if ($param['eid'] == '23090223' || $param['eid'] == '23090243' || $param['eid'] == '23090265' || $param['eid'] == '23090266' || $param['eid'] == '23110363') {
                    $unifiedProjectCode = '56c737da-f636-475c-b010-03964982ed6e';
                }
                $send['params'] = [
                    "unifiedProjectCode" => $unifiedProjectCode,
                    "dataTimeStamp" => time() * 1000,
                    "deviceFactory" => "sdty",
                    "protocolVer" => "protocolVer",
                    "deviceSN" => $param['eid'],
                    "deviceTCPIP" => "127.0.0.1",
                    "deviceTCPPoot" => "0",
                    "date" => date('Y-m-d', time()),
                    "time" => date('H:i:s', time()),
                    "operaterNo" => "0",
                    "name" => '1',
                    "idNo" => '370682196711307833',
                    "workStatus" => "0",
                    "motorStatus" => "0",
                    "multiple" => 2,
                    "realtimePeople" => $param['number'],
                    "realtimeWeight" => $param['weight'],
                    "realtimeSpeed" => $param['speed'],
                    "realtimeHeight" => $param['height'],
                    "realtimeFloor" => 0,
                    "realtimeDipX" => $param['tilt_x'],
                    "realtimeDipY" => $param['tilt_y'],
                    "realtimeWindSpeed" => $param['wind_speed'],
                    "realtimeWindLevel" => 1,
                    "obliguityXAlarm" => "0",
                    "obliguityYAlarm" => "0",
                    "windSpeedAlarm" => "0",
                    "limitAlarm" => "0",
                    "antiDropAlarmt" => "0",
                    "outDoorStatus" => "0",
                    "heightAlarm" => "0",
                    "speedAlarm" => "0",
                    "weightPreAlarm" => "0",
                    "speedPreAlarm" => "0",
                    "heightPreAlarm" => "0",
                    "obliguityXPreAlarm" => "0",
                    "obliguityYPreAlarm" => "0",
                    "windSpeedPreAlarm" => "0",
                    "peopleAlarm" => "0",
                    "weightAlarm" => "0",
                    "noError" => "0",
                    "peopleCntSetError" => "0",
                    "speedError" => "0",
                    "floorSetError" => "0",
                    "obliguityXError" => "0",
                    "obliguityYError" => "0",
                    "weightError" => "0",
                    "windSpeedSetError" => "0",
                    "wirelessSetError" => "0",
                    "noPreAlarm" => "0",
                    "rangeError" => "0",
                    "heightError" => "0",
                    "angleError" => "0",
                    "obliguityError" => "0",
                    "gpsError" => "0",
                    "idError" => "0",
                    "noAlarm" => "0",
                    "momentAlarm" => "0",
                    "windSpeedAlarm" => "0",
                    "heightAlarm" => "0",
                    "minRangeAlarm" => "0",
                    "maxRangeAlarm" => "0",
                    "posAngleAlarm" => "0",
                    "negAngleAlarm" => "0",
                    "obliguityAlarm" => "0",
                    "forbidEntryAlarm" => "0",
                    "forbidSuspend2Alarm" => "0",
                    "forbidSuspend4Alarm" => "0",
                    "otherField" => "",
                ];
                //-----未提供
                $send['params'] = json_encode($send['params']);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'form_params' => $send,
                    'headers' => [
                        'Authorization' => $Authorization,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($stringBody, 'ForwardController213');
                return 1;
                break;
            case 214:
                //张姐-烟台客户-新点
                $url = 'http://rec.ehelpers.cn/api/Lift/LiftCurrent';
                $aes_data = date('Ynj', time());
                $appid = 'cf709c3f5c1a11eda82f43d978cd9999';
                $method = 'AES-128-ECB';
                $key = 'epointforward@!1';
                $AppSecret = openssl_encrypt($aes_data, $method, $key);
                $send = [
                    "AppSecret" => $AppSecret,
                    "appid" => $appid,
                    "Weight" => $param['weight'],
                    "Height" => $param['height'],
                    "Speed" => $param['speed'],
                    "WindSpeed" => $param['wind_speed'],
                    "AngleX" => $param['tilt_x'],
                    "AngleY" => $param['tilt_y'],
                    "Pnum" => $param['number'],
                    "RateWeight" => 10,
                    "SensorStatus" => '00000000000000000000000000000000',
                    "AlarmCode" => '00000000000000000000000000000000',
                    "Datetime" => date('Y-m-d H:i:s', time()),
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 215:
                //于-日照客户-tianxi
                $url = 'http://rizhaotianxi.qd27.com/api/tower_log';
                $code = 'M007';
                $time = time();
                $token = 'M00720221227T';
                $sign = md5($token . $time);
                $send['code'] = $code;
                $send['sign'] = $sign;
                $send['time'] = $time;
                $send['data'] = [
                    "equipment_no" => $param['eid'],
                    "height" => $param['height'],
                    "range" => $param['amplitude'],
                    "rotation" => $param['round'],
                    "liftingweight" => $param['weight'],
                    "force" => $param['moment'],
                    "forcedistance" => $param['moment_percent'],
                    "windspeed" => $param['wind_speed'],
                    "magnification" => $param['override'],
                    "tiltX" => $param['angle_x'],
                    "tiltY" => $param['angle_y'],
                    "pushtime" => date('Y/m/d H:i', time()),
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 216:
                //于-日照客户-tianxi-升降机
                $url = 'http://rizhaotianxi.qd27.com/api/lifter_log';
                $code = 'M007';
                $time = time();
                $token = 'M00720221227T';
                $sign = md5($token . $time);
                $send['code'] = $code;
                $send['sign'] = $sign;
                $send['time'] = $time;
                $send['data'] = [
                    "equipment_no" => $param['eid'],
                    "height" => $param['height'],
                    "speed" => $param['speed'],
                    "weight" => $param['weight'],
                    "load" => $param['elevator_load'],
                    "number" => $param['number'],
                    "tilt_x" => $param['tilt_x'],
                    "tilt_y" => $param['tilt_y'],
                    "front_door_status" => $param['front_door_status'],
                    "rear_door_status" => $param['back_door_status'],
                    "run_status" => $param['run_status'],
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;

            case 101:
                //于-建云塔吊黑匣子
                // $url = 'http://superadmin.anjyzn.cn/api/IntelligentizationSite/saveIntelSiteMsg';
                $url1 = 'https://api.shandongjianyun.com/api/IntelligentizationSite/saveIntelSiteMsg';
                $accessToken1 = 'gTyv1NARogxtVgK8';
                $send1 = [
                    "msgid" => time(),
                    "manufactor" => '山东探越',
                    "proversion" => "1.0",
                    "recordTime" => date('Y-m-d H:i:s', time()),
                    "deviceNo" => (int) $param['eid'],
                    "deviceType" => 'TowerCrane',
                    "towernumber" => $param['eid'],
                    "cranemodel" => 'T104',
                    "multiple" => $param['override'],
                    "reararmlength" => 20,
                    "forearmlength" => 50,
                    "armheight" => 50,
                    "maxliftingweight" => 10,
                    "loadNum" => 0,
                    "height" => $param['height'],
                    "amplitude" => $param['amplitude'],
                    "rotation" => $param['round'],
                    "weight" => $param['weight'],
                    "torque" => $param['moment'],
                    "wightPercent" => $param['moment'],
                    "windspeed" => $param['wind_speed'],
                    "tilt" => $param['angle_x'],
                    "rope" => 0,
                    "relayStatus" => "00000000",
                    "status" => 0,
                ];

                $client1 = new Client;
                $response1 = $client1->request('POST', $url1, [
                    'json' => $send1,
                    'headers' => [
                        'accessToken' => $accessToken1,
                    ],
                ])->getBody();
                $stringBody1 = (string) $response1;
                // Log::write($stringBody1, 'ForwardController_101');
                //--转新点--
                $url = 'http://zhgd.ytzjj.gov.cn/IOTWebService/rest/TowerCraneDataService/PushRealTimeInfo';
                $Authorization = 'Bearer 1f7f736d9ead4f25ffb200438bff04a7';
                // $unifiedProjectCode = 'bd2a2a2d-c54e-4bdc-adbe-4ceeba0aab71';
                $unifiedProjectCode = 'fa5e37aa-4d43-4cde-807d-128011fe227d';
                $send['params'] = [
                    "unifiedProjectCode" => $unifiedProjectCode,
                    "dataTimeStamp" => time() * 1000,
                    "deviceFactory" => "sdty",
                    "protocolVer" => "protocolVer",
                    "deviceSN" => $param['eid'],
                    "deviceTCPIP" => "127.0.0.1",
                    "deviceTCPPoot" => "0",
                    "date" => date('Y-m-d', time()),
                    "time" => date('H:i:s', time()),
                    "operaterNo" => "0",
                    "name" => '1',
                    "idNo" => '1',
                    "workStatus" => "0",
                    "motorStatus" => "0",
                    "multiple" => 2,
                    "moment" => $param['moment'],
                    "weight" => round($param['weight'] / 1000, 2),
                    "ratedWeight" => "10",
                    "windSpeed" => $param['wind_speed'],
                    "windLevel" => "1",
                    "rrange" => $param['amplitude'],
                    "height" => $param['height'],
                    "angle" => $param['angle_x'],
                    "obliguity" => $param['angle_x'],
                    "noError" => "0",
                    "weightError" => "0",
                    "windSpeedError" => "0",
                    "rangeError" => "0",
                    "heightError" => "0",
                    "angleError" => "0",
                    "obliguityError" => "0",
                    "gpsError" => "0",
                    "idError" => "0",
                    "noAlarm" => "0",
                    "momentAlarm" => "0",
                    "windSpeedAlarm" => "0",
                    "heightAlarm" => "0",
                    "minRangeAlarm" => "0",
                    "maxRangeAlarm" => "0",
                    "posAngleAlarm" => "0",
                    "negAngleAlarm" => "0",
                    "obliguityAlarm" => "0",
                    "forbidEntryAlarm" => "0",
                    "forbidSuspend2Alarm" => "0",
                    "forbidSuspend4Alarm" => "0",
                    "otherField" => "",
                ];
                //-----未提供
                $send['params'] = json_encode($send['params']);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'form_params' => $send,
                    'headers' => [
                        'Authorization' => $Authorization,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 102:
                //众数科技-张姐
                $url = 'http://219.146.82.130:10516/api/v1/hardware/TowerRealData';
                $send = [
                    "eid" => $param['eid'],
                    "height" => $param['height'], //高度
                    "range" => $param['amplitude'], //幅度
                    "rotation_angle" => $param['round'], //回转角度
                    "lifting_weight" => round($param['weight'] / 1000, 2), //吊重
                    "force" => $param['moment'], //力距
                    "force_distance" => $param['moment_percent'], //力距百分比
                    "wind_speed" => $param['wind_speed'], //风速
                    "magnification" => 2, //倍率
                    "sensor_status" => 0, //传感器状态
                    "anteversion" => $param['angle_x'], //前倾角
                    "anteversion_x" => $param['angle_x'], //倾角X
                    "anteversion_y" => $param['angle_y'],
                    "safeTorque" => 6,
                    "loadRatio" => round($param['weight'] / 6, 2),
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 220:
                //众数科技-张姐
                $url = '219.146.82.130:10516/system/lift/realData';
                $send = $param;
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 221:
                //青岛易建智慧
                $url = 'http://221.0.183.26:9880/api/ty/elevator/data';
                $send = $param;
                $send['weight'] = rand(1, 200);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 222:
                //黄冈工程建设监管平台-升降机实时数据
                /*
                hgctlljy         hgctlljy123
                 */
                $url = '122.189.98.132:8012/smart-gvp/api/v1/reportDeviceLift/deviceLift';
                // $url = '122.189.98.132:8012/smart-gvp/api/v1/reportDeviceLiftBase/deviceLiftBase';//基础数据
                $token = 'f00c9c4b-b4fb-463a-aebe-e72a67b42d98';
                if ($param['eid'] == 23110361) {
                    $token = 'dcb3bceb-b7cd-473f-8b58-8a6bd98ce6eb';
                }
                if ($param['eid'] == 23110367) {
                    $token = 'dd67688e-6ace-4d5c-9322-7d4675810bfd';
                }
                if ($param['eid'] == 23110419 || $param['eid'] == 23110421 || $param['eid'] == 23110417) {
                    $token = '31711789-c3bc-4d14-8727-8f3092bce8a7';
                }
                if ($param['eid'] == 23110407 || $param['eid'] == 23110415) {
                    $token = 'e8db5daf-b362-413b-ad7b-14942a460fda';
                }
                if ($param['eid'] == 23120433 || $param['eid'] == 23120432) {
                    $token = 'b583baf9-4ddb-41fc-ad26-34ae125ff7f5';
                }
                if ($param['eid'] == 23110390 || $param['eid'] == 23110398 || $param['eid'] == 23110411) {//湖北金港汽车公园
                    $token = '4cc6cdf0-44c5-49f9-b179-96e9116eef63';
                }
                if ($param['eid'] == 24020514) {//凤凰城状元府
                    $token = '6aa429f8-0443-4323-ae6c-c030507af81d';
                }
                if ($param['eid'] == 23110403) {//香榭水岸房地产项目 
                    $token = '295b6510-0966-4f90-88f8-de42c83412a1';
                }
                $send['token'] = $token;
                $send['body'][] = [
                    "creanceId" => (string) $param['eid'],
                    "deviceId" => (string) $param['eid'],
                    "deviceName" => (string) $param['eid'],
                    "recDate" => date('Y-m-d H:i:s', time()),
                    "liftLoad" => $param['weight'],
                    "height" => $param['height'],
                    "speed" => $param['speed'],
                    "angle" => $param['tilt_x'],
                    "windSpeed" => $param['wind_speed'],
                    "peopleNum" => $param['number'],
                ];
                // $send['body'][] = [
                //     "creanceId" => (string) $param['eid'],
                //     "deviceId" => (string) $param['eid'],
                //     "deviceName" => (string) $param['eid'],
                //     "recDate" => date('Y-m-d H:i:s', time()),
                //     "minHeight" => 0,
                //     "maxHeight" => 60,
                //     "minFloor" => -3,
                //     "maxFloor" => 20,
                //     "minSpeed" => 0,
                //     "maxSpeed" => 10,
                //     "minWindSpeed" => 0,
                //     "maxWindSpeed" => 10.8,
                //     "minPeopleNum" => 0,
                //     "maxPeopleNum" => 8,
                // ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($send, 'ForwardController222');
                Log::write($stringBody, 'ForwardController222');
                return 1;
                break;
            case 217:
                //宁津升降机-于
                $url = 'http://nj.qdgcit.com:8889/qdoner/datarecept/dataUpload/elevator/saveData';
                /*
                618    12#楼升降机左    22110094
                619    5#楼升降机左    22110097
                620    8#楼升降机左    22110078
                621    9#楼升降机左    22110095
                622    12#楼升降机右    22110071
                623    5#楼升降机右    22110110
                624    8#楼升降机右    22110099
                625    9#楼升降机右    22110109
                项目id:188
                 */
                $deviceSn = [
                    '22110094' => 618,
                    '22110097' => 619,
                    '22110078' => 620,
                    '22110095' => 621,
                    '22110071' => 622,
                    '22110110' => 623,
                    '22110099' => 624,
                    '22110109' => 625,
                ];
                $send[] = [
                    "projectId" => 188,
                    "deviceSn" => $deviceSn[$param['eid']],
                    "deviceTime" => date('Y-m-d H:i:s', time()),
                    "earlyAlarm" => 0,
                    "alarm" => 0,
                    "numberOfPeople" => $param['number'],
                    "wind" => $param['wind_speed'],
                    "load" => $param['weight'],
                    "percentRate" => $param['elevator_load'],
                    "height" => $param['height'],
                    "speed" => $param['speed'],
                    "mileage" => 8.0,
                    "runningState" => $param['run_status'],
                    "beforeLock" => $param['front_door_status'],
                    "afterLock" => $param['back_door_status'],
                    "angle" => $param['tilt_x'],
                    "yAngle" => $param['tilt_y'],
                ];
                $json = json_encode($send);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;

            case 103:
                //宁津塔机-于
                $url = 'http://nj.qdgcit.com:8889/qdoner/datarecept/dataUpload/tower/saveData';
                $deviceSn = [
                    '12110134' => 616,
                    '12110137' => 617,
                ];
                $send[] = [
                    "projectId" => 188,
                    "deviceSn" => $deviceSn[$param['eid']],
                    "deviceTime" => date('Y-m-d H:i:s', time()),
                    "load" => $param['weight'],
                    "angle" => $param['round'],
                    "radius" => $param['amplitude'],
                    "height" => $param['height'],
                    "percent" => $param['moment_percent'],
                    "safeLoad" => 10,
                    "fall" => 2,
                    "alarm0" => 0,
                    "alarm1" => 0,
                    "alarm2" => 0,
                    "obliqueDirection" => 0,
                    "windPercentage" => 0,
                    "obliguityPercentage" => 0,
                    "weightPercentage" => 0,
                    "brakingStatus" => 0,
                    "obliqueAngle" => $param['angle_x'],
                    "windSpeed" => $param['wind_speed'],
                ];
                $json = json_encode($send);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 104:
                case104:
                //--转新点--烟台建大文华苑项目一标段-塔机
                $url = 'http://zhgd.ytzjj.gov.cn/IOTWebService/rest/TowerCraneDataService/PushRealTimeInfo';
                $Authorization = 'Bearer 1f7f736d9ead4f25ffb200438bff04a7';
                $unifiedProjectCode = 'd2eed24e-cb5e-4627-833f-6845acd092fd';
                if ($param['eid'] == '13020291' || $param['eid'] == '12110121') {
                    $unifiedProjectCode = '2cdc4e0e-ff53-4849-8a14-2c19057dc6b9';
                }
                if ($param['eid'] == '13070991' || $param['eid'] == '13071026') {
                    $unifiedProjectCode = '82f84b74-de34-4a35-a32b-fa3e9d1de743';
                }
                $send['params'] = [
                    "unifiedProjectCode" => $unifiedProjectCode,
                    "dataTimeStamp" => time() * 1000,
                    "deviceFactory" => "sdty",
                    "protocolVer" => "protocolVer",
                    "deviceSN" => $param['eid'],
                    "deviceTCPIP" => "127.0.0.1",
                    "deviceTCPPoot" => "0",
                    "date" => date('Y-m-d', time()),
                    "time" => date('H:i:s', time()),
                    "operaterNo" => "0",
                    "name" => '1',
                    "idNo" => '1',
                    "workStatus" => "0",
                    "motorStatus" => "0",
                    "multiple" => 2,
                    "moment" => $param['moment'],
                    "weight" => round($param['weight'] / 1000, 2),
                    "ratedWeight" => "10",
                    "windSpeed" => $param['wind_speed'],
                    "windLevel" => "1",
                    "rrange" => $param['amplitude'],
                    "height" => $param['height'],
                    "angle" => $param['angle_x'],
                    "obliguity" => $param['angle_x'],
                    "noError" => "0",
                    "weightError" => "0",
                    "windSpeedError" => "0",
                    "rangeError" => "0",
                    "heightError" => "0",
                    "angleError" => "0",
                    "obliguityError" => "0",
                    "gpsError" => "0",
                    "idError" => "0",
                    "noAlarm" => "0",
                    "momentAlarm" => "0",
                    "windSpeedAlarm" => "0",
                    "heightAlarm" => "0",
                    "minRangeAlarm" => "0",
                    "maxRangeAlarm" => "0",
                    "posAngleAlarm" => "0",
                    "negAngleAlarm" => "0",
                    "obliguityAlarm" => "0",
                    "forbidEntryAlarm" => "0",
                    "forbidSuspend2Alarm" => "0",
                    "forbidSuspend4Alarm" => "0",
                    "otherField" => "",
                ];
                //-----未提供
                $send['params'] = json_encode($send['params']);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'form_params' => $send,
                    'headers' => [
                        'Authorization' => $Authorization,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($stringBody, 'ForwardController104');
                return 1;
                break;
            case 218:
                // 湖北升思科技股份有限公司--李珊珊
                // $conf = [
                //     'host' => '36.148.23.13',
                //     'port' => 5672,
                //     'user' => 'external',
                //     'pwd' => '72fs32d',
                //     'vhost' => '/',
                // ];
                $conf = [
                    'host' => '219.139.130.110',
                    'port' => 5674,
                    'user' => 'qzsb0001',
                    'pwd' => 'Qzsb@)!(321',
                    'vhost' => '/qzsb',
                ];
                // $vcode = 'xxx,xxx,xxx';
                $vcode = $param['other'];

                /*
                5 额定重量(15.00)
                6 实际重量(12.35) $param['weight'];
                7 力 矩(145.63) $param['moment'];
                8 力矩百分比(98.32) $param['moment'];
                9 小车幅度(13.25) $param['amplitude'];
                10 吊钩高度(接近地面高度为 0，吊钩完全收起则为最大高度) $param['height'];
                11 回转角度(126.32) $param['round'];
                12 风速级别(6.32) $param['wind_speed'];
                13 塔臂倾角(+12.5) $param['angle_x'];
                 */
                $routingKey = 'QZSB-INTERFACE'; //路由关键字(也可以省略)
                $conn = new AMQPStreamConnection( //建立生产者与mq之间的连接
                    $conf['host'], $conf['port'], $conf['user'], $conf['pwd'], $conf['vhost']
                );
                $channel = $conn->channel(); //在已连接基础上建立生产者与mq之间的通道
                $msgBody = json_encode(["data" => "00008," . $param['eid'] . "," . $param['eid'] . ",xxx," . $param['weight'] . "," . $param['elevator_load'] . "," . $param['number'] . "," . $param['height'] . "," . $param['height'] . "," . $param['speed'] . "," . $param['tilt_x'] . "," . $param['tilt_x'] . "," . $param['tilt_y'] . "," . $param['tilt_y'] . ",0," . $param['front_door_status'] . "," . $param['back_door_status'] . "," . "0,0,0,0,0,0,0,0,0,0,30," . $vcode, "author" => "WT", "tag" => "DATA"]);
                // Log::write($msgBody, 'ForwardController_218');
                $msg = new AMQPMessage($msgBody, ['content_type' => 'text/plain', 'content-encoding' => 'utf-8', 'publisher-confirms' => true, 'publisher-returns' => true, 'template' => ['mandatory' => true]]); //生成消息
                $r = $channel->basic_publish($msg, '', $routingKey); //推送消息到某个交换机
                $channel->close();
                $conn->close();
                break;
            case 219:
                //盘石-万年智慧工地对接群
                $url = 'https://smart.ilabx.cn/PY220007/user/MonitorDumbwaiterData/addElevatorData';
                $send = [
                    "devsn" => $param['eid'],
                    "localetime" => date('Y-m-d H:i:s', time()),
                    "weight" => $param['weight'],
                    "height" => $param['height'],
                    "speed" => $param['speed'],
                    "fdoor" => $param['front_door_status'],
                    "bdoor" => $param['back_door_status'],
                    "obliqueX" => $param['tilt_x'],
                    "obliqueY" => $param['tilt_y'],
                    "direction" => $param['run_status'],
                    "state" => 0,
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($stringBody, 'ForwardController');
                break;
            case 223:
                //袁燚燚-湖北武汉
                $url = 'https://gateway-dev.yiruibim.com/zhgd/tywl_api/v1/lift_device/basic_data';
                // $date=gmstrftime("%a, %d %b %Y %T %Z",time());
                $date = gmstrftime("%a, %d %b %Y %T GMT", time());
                $AccessKey = 'DiDjZSDhwViQaHixWhunTywl';
                $SecretKey = 'bWbsNqbxgtzkpuaBiNnIRNKIBUTywl';

                /* NONCE */
                $length = "32"; //字符串长度
                $characters = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                $randomString = "";
                for ($i = 0; $i < $length; $i++) {
                    $randomString .= $characters[rand(0, strlen($characters) - 1)];
                }
                $Nonce = $randomString;
                $send = [
                    "deviceSn" => '12345',
                    "time" => date('Y-m-d H:i:s', time()),
                    "maxPeople" => '10',
                    "maxWeight" => '10',
                    "maxHeight" => '10',
                ];
                $json = json_encode($send);
                $ContentMD5 = md5($json);
                $string = $SecretKey . '_' . $ContentMD5 . '_' . $date . '_' . $Nonce;
                $sha256 = hash("sha256", $string);
                $Authorization = 'zhgdpartner ' . $AccessKey . ':' . $sha256;

                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                    'headers' => [
                        'Date' => $date,
                        'Nonce' => $Nonce,
                        'Content-MD5' => $ContentMD5,
                        'Authorization' => $Authorization,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($json, 'ForwardController');
                Log::write($stringBody, 'ForwardController');
                break;
            case 105:
                //赵磊--济工网
                $host = 'http://che.gongyoumishu.com:8083';
                $url = '/smartsite/crane/InsertCraneInformation';
                // $url = '/smartsite/crane/InsertCraneMessage';
                $appId = 'c3f5ea2c1e2849299559ddd4e74f99bc';
                $secret = 'd22948c8f7672daaa83f36d8209f439e';
                $timestamp = time() * 1000;

                $token_url = 'http://che.gongyoumishu.com:8083/webapi/credential?appId=' . $appId . '&secret=' . base64_encode($secret);
                $client = new Client;
                $response_token = $client->request('POST', $token_url, [])->getBody();
                $response_token = json_decode($response_token)->data->token;
                $token = $response_token;

                $str = $url . "?" . "appId=" . $appId . "&tokenSign=" . $token . "&timestamp=" . $timestamp;
                $tokenSign = md5($str);
                $send_url = $host . $url . "?" . "appId=" . $appId . "&tokenSign=" . $tokenSign . "&timestamp=" . $timestamp;
                /* 设备信息 */
                $dataArr_info = [
                    "device_id" => $param['eid'],
                    "localcoordinatesx" => 0.00,
                    "localcoordinatesy" => 0.00,
                    "forearmlength" => 60.00,
                    "reararmlength" => 12.00,
                    "topheight" => 6.00,
                    "armheight" => 45.00,
                    "maxliftingweight" => 10.00,
                    "ratedliftingmoment" => 60.00,
                    "cranemodel" => "6020",
                    "towercranemodel" => 'sdty',
                    "create_time" => date('Y-m-d H:i:s', time()),
                ];
                /* 数据 */
                $dataArr = [
                    "device_id" => $param['eid'],
                    "device_status" => 1,
                    "data_time" => date('Y-m-d H:i:s', time()),
                    "angle" => $param['round'],
                    "radius" => $param['amplitude'],
                    "hight" => $param['height'],
                    "loadweightr" => $param['weight'],
                    "lijupercent" => $param['moment_percent'],
                    "fengsupercent" => 0.00,
                    "windspeed" => $param['wind_speed'],
                    "fall" => 0.00,
                    "direction" => $param['angle_x'],
                    "reason" => 0,
                    "reasonStr" => "正常",
                    "create_time" => date('Y-m-d H:i:s', time()),
                    "update_time" => date('Y-m-d H:i:s', time()),
                    "remark" => null,
                ];
                $client = new Client;
                $response = $client->request('POST', $send_url, [
                    'json' => [$dataArr],
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($stringBody, 'ForwardController');
                break;
            case 108:
                //鼎力兴-德州平台对接-袁
                $url = 'http://222.133.41.47:8090/XHTAPI/api/ZHGD_API';
                /* 数据 */
                $paramJsonData = [
                    "DeviceNo" => (int) $param['eid'],
                    // "SN"=> "135XXXXXX",
                    "Amplitude" => $param['amplitude'],
                    "Angle" => $param['angle_x'],
                    "ArmHeight" => 34,
                    "ForeArmLength" => 50,
                    "Height" => $param['height'],
                    "Weight" => $param['weight'],
                    "Windspeed" => $param['wind_speed'],
                    "Rotation" => $param['round'],
                    "MaxLoad" => 4,
                    "SafeLoad" => 4,
                    "RatedTorque" => 95,
                    // "LocationX"=> "123.6",
                    // "LocationY"=> "114.5",
                    "AL_ForbiddenZone" => "0",
                    "AL_HardwareFault" => "0",
                    "AL_Incline" => "0",
                    "AL_Limit" => "0",
                    "AL_Load" => "0",
                    "AL_ObstacleCollision" => "0",
                    "AL_Torque" => "0",
                    "AL_TowerCollision" => "0",
                    "AL_Windspeed" => "0",
                    "Time" => date('Y-m-d H:i:s', time()),
                    "Remarks" => "",
                ];
                $send = [
                    "ApiKey" => 'ae5992c5-e8e7-421c-8157-3a5ac08e8cdd',
                    "FunctionName" => 'Xht_TJDateRecFac',
                    "paramJsonData" => $paramJsonData,
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($send, 'ForwardController108');
                // Log::write($stringBody, 'ForwardController108');
                break;
            case 224:
                //德州平台-王兴华升降机
                $url = 'http://222.133.41.47:8090/XHTAPI/api/ZHGD_API';
                $prjKey = 'Odnb5L//h3ZkRMIluXJL6U9OkbMjZh9i4oa/jVNttL0=';
                $deviceKey = 'FCy5g6jqZsPvOOdqP/PLoITCwyu4IR035E12gOVZTI8=';

                if (Cache::get('case_224')) {
                    $token = Cache::get('case_224');
                } else {
                    $token_body = [
                        "appKey" => "5729613445900833079",
                        "appSercert" => "5267865bd19845a1adb59445b655afb9",
                    ];
                    $client = new Client;
                    $response = $client->request('POST', 'http://222.133.41.47:8090/XHTAPI/api/GetToken', [
                        'json' => $token_body,
                    ])->getBody();
                    $stringBody = (string) $response;
                    $token = json_decode($stringBody)->token;
                    Cache::set('case_224', $token, 3600);
                }
                /* 数据 */
                /*
                weightPercent    nvarchar(50)    重量百分比
                heightPercent    nvarchar(50)    高度百分比
                speedStatus    nvarchar(50)    操作信号，详见【数据词典】    非空;词典
                tilt2    nvarchar(50)    实时倾斜度2    非空
                tiltPercent2    nvarchar(50)    倾斜度百分比2
                foreDoorStatus    nvarchar(50)    前门状态，详见【数据词典】    非空;词典
                behindDoorStatus    Nvarchar(50)    后门状态，详见【数据词典】    非空;词典
                lockStatus    nvarchar(50)    门锁异常，详见【数据词典】    非空;词典
                AL_Weight    char(1)    是否超重报警，详见【数据词典】    非空;词典
                AL_Height    char(1)    是否高度限位报警，详见【数据词典】    非空;词典
                AL_NumOfPeople    char(1)    是否人数报警，详见【数据词典】    非空;词典
                AL_foreDoorStatus    char(1)    是否前门锁状态报警，详见【数据词典】    非空;词典
                AL_behindDoorStatus    char(1)    是否后门锁状态报警，详见【数据词典】    非空;词典
                DeviceNo    varchar(50)    设备编号    非空
                tilt1    nvarchar(50)    实时倾斜度1    非空
                tiltPercent1    nvarchar(50)    倾斜度百分比1
                AL_Speed    char(1)    是否超速报警，详见【数据词典】    非空;词典
                AL_tilt1    char(1)    是否倾斜报警，详见【数据词典】    非空;词典

                 */
                $paramJsonData = [
                    "DeviceNo" => (int) $param['eid'],
                    "Height" => $param['height'],
                    "Weight" => $param['weight'],
                    "Speed" => $param['speed'],
                    "NumOfPeople" => $param['number'],
                    "Time" => date('Y-m-d H:i:s', time()),
                    "speedStatus" => "0",
                    "tilt2" => "36.36",
                    "tiltPercent2" => "15",
                    "foreDoorStatus" => "0",
                    "behindDoorStatus" => "0",
                    "lockStatus" => "0",
                    "AL_Weight" => "0",
                    "AL_Height" => "0",
                    "AL_NumOfPeople" => "0",
                    "AL_foreDoorStatus" => "0",
                    "AL_behindDoorStatus" => "0",
                    "tilt1" => "10.0",
                    "tiltPercent1" => "50",
                    "AL_Speed" => "0",
                    "AL_tilt1" => "0",
                ];
                $send = [
                    "token" => $token,
                    "FunctionName" => 'SJJRealData',
                    "prjKey" => $prjKey,
                    "deviceKey" => $deviceKey,
                    "paramJsonData" => $paramJsonData,
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($send, 'ForwardController224');
                Log::write($stringBody, 'ForwardController224');
                break;
            case 225:
                //苏州信拓业-袁燚燚
                $url = 'http://123.60.57.233:8082/ayy/api/elevator';
                $send['deviceId'] = (int) $param['eid'];
                $send['runStatus'] = $param['run_status'];
                $send['weight'] = $param['weight'];
                $send['height'] = $param['height'];
                $send['speed'] = $param['speed'];
                $send['windSpeed'] = $param['wind_speed'];
                $send['xinclination'] = $param['tilt_x'];
                $send['yinclination'] = $param['tilt_y'];
                $send['numberOfPeopleLoaded'] = $param['number'];
                $send['dipAngle'] = $param['tilt_x'];
                $send['singleDoorStatus'] = $param['front_door_status'];
                $send['doubleDoorStatus'] = $param['back_door_status'];
                $send['topDoorStatus'] = $param['top_door_status'];
                $send['sendTime'] = date('Y-m-d H:i:s', time());
                //-----未提供
                // $send['idCard'] = '--';
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($send, 'ForwardController225');
                // Log::write($stringBody, 'ForwardController225');
                break;
            case 226:
                //苏州信拓业-袁燚燚&&湖溪云镜
                $url = 'http://yzt.yztzn.com/yzt-zhgd';
                // $appld = '3725660410834841878a4b652298bd2d';
                $appld = '4352f5e0e9c24bddba0e9461d2244274';
                // $key = 'MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAquCohk8Z5Hi48O9xH+SW7TkvcMh8OxcH8IMIUH9OPhpQBFVsiPzZGY+h2H+dMvAMYaETyv3XddD6pKtfIr0VcQIDAQABAkBnvbUStXtWxiQhwny/jBxFMW6n3k/t3/GmBydJF8D82iW8OIhtMZ67WvHHXlqVOCW7Cg2yEnrwoD3mWofOH3bxAiEA5JGLTxaGEPRo8Eq9nNl+sCnyGqg/PWOVcLC7xP9WOOMCIQC/YqNgqNTzqLsH6QSr/Prm/lGFAyOcV36XeTjVggoMmwIgaRUIyPl/9XeIb0DNX7kWZ4NBTUQgnuaTo9V83hrN1yUCIDJ00Nnk6O+sJlL5je/B7GwF1HwazcKkFo3cua0gcYHNAiBHNmu/yEz++2dHCvI3WBsAzWf8yC0CKiG4ixkVW/Hakg==';
                $key = 'MIIBUgIBADANBgkqhkiG9w0BAQEFAASCATwwggE4AgEAAkEAixbcm2MbnTGyZw+arcIk7CjSIGEc8W6d6g/mqMj0o4o1i2U9xX4MHzpkYsRyelc2ydrxlD5kXPN1fxd6p3tqPQIDAQABAkAIRdHVRC3OSbhsvNbcYuHDUiI9XslT6tplo5B6lYlHeMhlIW+Dw5rFtAswYX4ewJMeTm93eB2vGffEv7Sdw1fBAiEA0rAcXXIjKmx3kGtCdJn/iPWq2a8ohnv+EpqDozqNGoUCIQCpALr5/cXla+j9+IOI9ZNR9S+VNV4IfMMFuBWoCxQKWQIfdAqLlOxIchVLxT9OWup20/h7IWpX57pjNdvkpQKatQIgJkiyEnt4XvZI+29WbKoky0Ydl1FVkdqhWyROU5je21ECIDHabPnBDyNAjoA55gu8FwlDtitCJNB8TSrC2At+tvKP';
                $api = '/zhgdEleAddrecord/saveRecord';
                $time = time() * 1000;
                $aes_data = 'appid=' . $appld . '&systemTime=' . $time . '&uri=' . $api;
                $method = 'AES-128-ECB';

                $sign = openssl_encrypt($aes_data, $method, $key);

                $send = [
                    "devsn" => (int) $param['eid'],
                    "makeFactory" => "yzts",
                    "localetime" => date('Y-m-d H:i:s', time()),
                    "weight" => $param['weight'],
                    "height" => $param['height'],
                    "speed" => $param['speed'],
                    "fdoor" => $param['front_door_status'],
                    "bdoor" => $param['back_door_status'],
                    "state" => 0,
                    "obliqueX" => $param['tilt_x'],
                    "obliqueY" => $param['tilt_y'],
                    "ws" => $param['wind_speed'],
                    "supportPopulation" => "1",
                    "population" => $param['number'],
                    "direction" => $param['run_status'],
                    "drivername" => $param['other'],
                    "drivercode" => 421102197208123667,
                ];
                $client = new Client;
                $response = $client->request('POST', $url . $api, [
                    'json' => $send,
                    'headers' => [
                        'appid' => $appld,
                        'systemTime' => $time,
                        'sign' => $sign,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($send);
                Log::write($send_json, 'ForwardController226');
                Log::write($stringBody, 'ForwardController226');
                break;
            case 106:
                //赵磊--湖北易通智联
                $host = 'https://www.etone.online/';
                $api = 'api/sendRealTimeData/';
                // $api = 'api/sendBaseData/'; //参数上报
                if (Cache::has('CASE_106_id')) {
                    $id = Cache::get('CASE_106_id');
                    $token = Cache::get('CASE_106_token');
                } else {
                    $token_send = [
                        'userName' => 'shandongtanyue',
                        'passWord' => 'et@20230608.',
                    ];
                    $client = new Client;
                    $response = $client->request('POST', 'https://www.etone.online/api/login/', [
                        'form_params' => $token_send,
                    ])->getBody();
                    $stringBody = (string) $response;
                    $token = json_decode($stringBody)->token;
                    $id = json_decode($stringBody)->id;
                    Cache::set('CASE_106_id', $id, 3600);
                    Cache::set('CASE_106_token', $token, 3600);
                }
                $dtu_arr = [
                    13060825 => 'YTZL-2023-99',
                    13060830 => 'YTZL-2023-100',
                    13060811 => 'YTZL-2023-101',
                    13060829 => 'YTZL-2023-102',
                    13020350 => 'YTZL-2023-103',
                    13060824 => 'YTZL-2023-104',
                    13040580 => 'YTZL-2023-110',
                    13070992 => 'YTZL-2023-135',
                    13071001 => 'YTZL-2023-134',
                    13071019 => 'YTZL-2023-133',
                    13070998 => 'YTZL-2023-136',
                    13030440 => 'YTZL-2023-5024',
                    13050746 => 'YTZL-2023-5025',
                    13050783 => 'YTZL-2023-5026',
                    13050757 => 'YTZL-2023-5027',
                    13060813 => 'YTZL-2023-5030',
                    13071000 => 'YTZL-2023-5032',
                    14031914 => 'YTZL-2024-5004',
                    14031915 => 'YTZL-2024-5005',
                ];
                $dtu = $dtu_arr[$param['eid']];
                /* 数据 */
                $data[] = [
                    "sys_time" => time(),
                    "devId" => $param['eid'],
                    "typeId" => 0,
                    "weight1" => $param['weight'],
                    "moment1" => $param['moment'],
                    "momentPer1" => $param['moment_percent'],
                    "height1" => $param['height'],
                    "rotation" => $param['round'],
                    "craneRange" => $param['wind_speed'],
                    "windSpeed" => $param['weight'],
                    "levelX" => $param['angle_x'],
                    "levelY" => $param['angle_y'],
                    "trollyNum" => 0,
                    "liftingNum" => 0,
                    "rate1" => 0,
                    "rate2" => 0,
                    "workingMode" => 0,
                    "bypassStatus" => 0,
                    "plc" => 2,
                    "power" => 0,
                    "weightStatus1" => 0,
                    "heightStatus1" => 0,
                    "rotationStatus" => 0,
                    "rangeStatus1" => 0,
                    "travelStatus" => 3,
                    "windSkidStatus" => 3,
                    "windStatus" => 0,
                    "levelStatus" => 3,
                    "weightStatus2" => 3,
                    "heightStatus2" => 3,
                    "rangeStatus2" => 3,
                    "momentLimit1" => 0,
                    "weightLimit1" => 0,
                    "momentLimit2" => 0,
                    "weightLimit2" => 0,
                    "upLimit1" => 0,
                    "downLimit1" => 0,
                    "turnLeftLimit" => 0,
                    "turnRightLimit" => 0,
                    "incRangeLimit" => 0,
                    "reducRangeLimit" => 0,
                    "upLimit2" => 0,
                    "downLimit2" => 0,
                    "gtUpLimit2" => 0,
                    "gtDownLimit2" => 0,
                    "windWarning" => 0,
                    "tUpLimit1" => 0,
                    "tDownLimit1" => 0,
                    "tTurnLeftLimit" => 0,
                    "tTurnRightLimit" => 0,
                    "tIncRangeLimit" => 0,
                    "tReducRangeLimit" => 0,
                    "tUpLimit2" => 0,
                    "tDownLimit2" => 0,
                    "rUpLimit1" => 0,
                    "rDownLimit1" => 0,
                    "rTurnLeftLimit" => 0,
                    "rTurnRightLimit" => 0,
                    "rIncRangeLimit" => 0,
                    "rReducRangeLimit" => 0,
                    "rUpLimit2" => 0,
                    "rDownLimit2" => 0,
                    "gtUpLimit1" => 0,
                    "gtDownLimit1" => 0,
                    "gtTurnLeftLimit" => 0,
                    "gtTurnRightLimit" => 0,
                    "gtIncRangeLimit" => 0,
                    "gtReducRangeLimit" => 0,
                    "gtTravelLimit1" => 0,
                    "gtTravelLimit2" => 0,
                    "momentPer2" => 0,
                    "moment2" => 0,
                    "weight2" => 0,
                    "ratedWeight1" => 0,
                    "ratedWeight2" => 0,
                    "height2" => 0,
                    "depth1" => 0,
                    "depth2" => 0,
                    "elevation" => 0,
                    "wind" => 0,
                    "tcX" => 0,
                    "tcY" => 0,
                ];
                // $data[] = [
                //     "sys_time" => time(),
                //     "devId" => $param['eid'],
                //     "typeId" => 0,
                //     "armLength" => 60,
                //     "armLength1" => 12,
                //     "baWidth" => 0,
                //     "csHeight" => 35,
                //     "towerCapHeight" => 0,
                //     "tcHeight" => 40,
                //     "rcDistance" => 0,
                //     "climbingFrame" => 0,
                //     "introPlatform" => 0,
                //     "relHeight" => 0,
                //     "tX" => 0,
                //     "tY" => 0,
                //     "trackDirection" => 0,
                //     "minAngleWarning" => 10,
                //     "minAngleAlarm" => 10,
                //     "maxAngleWarning" => 15,
                //     "maxAngleAlarm" => 15,
                //     "upLimitWarning" => 0,
                //     "upLimitAlarm" => 195,
                //     "minRangeWarning" => 0,
                //     "minRangeAlarm" => 0,
                //     "maxRangeWarning" => 0,
                //     "maxRangeAlarm" => 0,
                //     "windWarning" => 10.9,
                //     "windAlarm" => 13.8,
                //     "windSpeedWarning" => 0,
                //     "windSpeedAlarm" => 0,
                //     "leftLimitWarning" => 0,
                //     "leftLimitAlarm" => 0,
                //     "rightLimitWarning" => 0,
                //     "rightLimitAlarm" => 0,
                //     "levelXWarning" => 10,
                //     "levelXAlarm" => 15,
                //     "levelYWarning" => 10,
                //     "levelYAlarm" => 15,
                //     "longitude" => 0,
                //     "latitude" => 0,
                // ];
                $send = [
                    "name" => "123",
                    "cname" => "123",
                    "token" => $token,
                    "dtu" => $dtu,
                    "frameType" => 16,
                    // "frameType" => 2,
                    "datas" => $data,
                    "id" => $id,
                ];
                $send_json = json_encode($send);
                $url = $host . $api;
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($send_json, 'ForwardController106');
                // Log::write($stringBody, 'ForwardController106');
                break;
            case 107:
                //赵磊--青岛易建智慧
                $url = 'http://221.0.183.26:9880/api/ty/tower/data';
                $send_json = json_encode($param);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $param,
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($stringBody, 'ForwardController107');
                break;
            case 109:
                //广州兴达技术
                $url = 'https://api.xingdagz.com/v1/Tanyue/runningData';
                $send_json = json_encode($param);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $param,
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($send_json, 'ForwardController109');
                // Log::write($stringBody, 'ForwardController109');
                break;
            case 110:
                //殷平辉-烟台
                // $url = 'http://b31c424.r8.cpolar.top/scs/towercrane/safetyTcRealtime/add';
                $url = 'https://api.tongzhuwang.com/tss/towercrane/safetyTcRealtime/add';
                // $token ='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2ODkwMjI0OTMsInVzZXJuYW1lIjoiYXBpIn0.ZHL2Dzu9VStq1sAaAlqJR34tX1P1T0yYgy_7Y4uZAGo';
                $token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDEyMjI1NTksInVzZXJuYW1lIjoicnpzcmprZmxfdGQifQ.KsmcgW5rLCG5UvIgFaC77ttbD9gqhgkeZLha7KcswC8';
                /*
                 */
                $send = [
                    "deadWeight" => $param['weight'],
                    "dip" => $param['angle_x'],
                    "equipmentName" => $param['eid'],
                    "equipmentNumber" => (int) $param['eid'],
                    "extent" => $param['amplitude'],
                    "height" => $param['height'],
                    "moment" => $param['moment'],
                    "momentRatio" => $param['moment_percent'],
                    "windLevel" => 0,
                    "loadRatio" => 0,
                    "delFlag" => 0,
                    "rotation" => $param['round'],
                    "windSpeed" => $param['wind_speed'],
                    "dateAndTime" => date('Y-m-d H:i:s', time()),
                    "tenantId" => 2853,
                ];
                $send_json = json_encode($send);

                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                    'headers' => [
                        'X-Access-Token' => $token,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($send_json, 'ForwardController110');
                Log::write($stringBody, 'ForwardController110');
                goto case104;
                break;
            case 111:
                //智建通塔机数据对接
                $url = 'http://zg.zhgdi.com:10000/tower/api_v4/open/uploadData';
                $send_json = json_encode($param);
                $send['dataType'] = "1";
                $send['dataJson'] = [
                    'venderCode' => 'fzOVX48Af0w3x3b9',
                    'version' => 1,
                    'serialNumber' => $param['eid'],
                    'uploadDate' => date('Y-m-d H:i:s', time()),
                    'angle' => $param['round'],
                    'radius' => $param['amplitude'],
                    'height' => $param['height'],
                    'loadWeight' => $param['weight'],
                    'currentAllowWeight' => 3,
                    'weightPercent' => $param['weight'],
                    'windSpeed' => $param['wind_speed'],
                    'tilt' => $param['angle_x'],
                    'workStatus' => 1,
                    'weightLimit' => 0,
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($send_json, 'ForwardController111');
                // Log::write($stringBody, 'ForwardController111');
                break;
            case 112:
                //小袁--苏州客户 筑安
                $url = 'http://material-api.huariot.com/';
                $key = 'sdtanyue001';
                $secret = '351E477205994EF48606B0E5475CE4E0';
                $getTokenUrl = 'api-gateway/api/third/v1/auth/login/';
                $token_url = $url . $getTokenUrl . '?' . 'key=' . $key . '&secret=' . $secret;
                $client = new Client;
                $response = $client->request('GET', $token_url)->getBody();
                $stringBody = json_decode((string) $response);
                $accessToken = $stringBody->data->accessToken;
                /* 设备上线 */
                $id = $param['other'];
                /* 实时数据添加 */
                $dataUrl = $url . 'device-socket/api/v1/third/tower-crane/real-data/';
                $send = [
                    "id" => $id,
                    "collection_time" => time() * 1000,
                    "wind" => $param['wind_speed'],
                    "height" => $param['height'],
                    "speed" => 0,
                    "angle" => $param['round'],
                    "work_status" => 1,
                    "radius" => $param['amplitude'],
                    "load_value" => round($param['weight'] / 1000, 2),
                    "safe_load_value" => 3,
                    "safe_torque" => 95, //安全力矩
                    "torque_percent" => $param['moment_percent'],
                    "obliquity_direct_angle" => $param['angle_x'],
                    "obliquity" => $param['angle_x'],
                    "obliquity2" => $param['angle_y'],
                    "fall" => 2,
                    "source_from" => 'sdty',
                ];
                $send_json = json_encode($send);
                $client = new Client;
                $response = $client->request('POST', $dataUrl, [
                    'json' => $send,
                    'headers' => [
                        'Authorization' => 'Bearer ' . $accessToken,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($send_json, 'ForwardController112');
                // Log::write($stringBody, 'ForwardController112');
                break;
            case 227:
                //小袁--苏州客户 筑安--升降机
                $url = 'http://material-api.huariot.com/';
                $key = 'sdtanyue001';
                $secret = '351E477205994EF48606B0E5475CE4E0';
                if($param['eid']==24030550 || $param['eid']==24030539 || $param['eid']==24030546){
                    //太仓环境
                    $url = 'http://36.133.170.81:8090/';
                    $key = 'szcfxx001';
                    $secret = '6255448EA4554253BE039CED57CB03BD';
                }
                $getTokenUrl = 'api-gateway/api/third/v1/auth/login/';
                $token_url = $url . $getTokenUrl . '?' . 'key=' . $key . '&secret=' . $secret;
                $client = new Client;
                $response = $client->request('GET', $token_url)->getBody();
                $stringBody = json_decode((string) $response);
                $accessToken = $stringBody->data->accessToken;
                /* 设备上线 */
                $id = $param['other'];
                /* 实时数据添加 */
                $dataUrl = $url . 'device-socket/api/v1/third/elevator/real-data/';
                $send = [
                    "id" => $id,
                    "index" => $param['eid'],
                    "gprs_online" => 1,
                    "warn_flag" => false,
                    "display_request_code" => 1,
                    "collection_time" => time() * 1000,
                    "load_value" => round($param['weight'] / 1000, 2),
                    "percent_rate" => $param['elevator_load'],
                    "number_of_people" => $param['number'],
                    "recognize_state" => 2,
                    "lock_state" => 1,
                    "limit_switch" => 1,
                    "handle" => 1,
                    "bypass" => 1,
                    "wind" => $param['wind_speed'],
                    "height" => $param['height'],
                    "speed" => $param['speed'],
                    "angle" => $param['tilt_x'],
                    "angle_rate" => $param['tilt_x'],
                    "angle2" => $param['tilt_y'],
                    "angle2_rate" => $param['tilt_y'],
                    "call_floor" => 0,
                    "rel_floor" => 0,
                    "running_state" => $param['run_status'],
                    "description" => 0,
                    "source_from" => 'sdty',
                ];
                $send_json = json_encode($send);
                $client = new Client;
                $response = $client->request('POST', $dataUrl, [
                    'json' => $send,
                    'headers' => [
                        'Authorization' => 'Bearer ' . $accessToken,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($send_json, 'ForwardController227');
                Log::write($stringBody, 'ForwardController227');
                break;
            case 228:
                //黄冈-升降机机实时数据
                $url = '122.189.98.132:8012/smart-gvp/api/v1/reportDeviceLift/deviceLift';
                // $url = '122.189.98.132:8012/smart-gvp/api/v1/reportDeviceLiftBase/deviceLiftBase';
                $token = 'a2465f3a-8acb-42ae-ba20-120a5a43db9c';

                // $token = '7c3f061d-0091-46cd-b06a-fdd0e5315831';
                $send['token'] = $token;
                $data = $param;

                // $body[] = [
                //     "creanceId" => (string) $data['eid'],
                //     "deviceId" => (string) $data['eid'],
                //     "recDate" => date('Y-m-d H:i:s', time()),
                //     "deviceName" => (string) $data['eid'],
                //     "minLoad" => 0,
                //     "maxLoad" => 200,
                //     "minFloor" => 0,
                //     "maxFloor" => 10,
                //     "minHeight" => 0,
                //     "maxHeight" => 100,
                //     "minSpeed" => 0,
                //     "maxSpeed" => 3,
                //     "minAngle" => 0,
                //     "maxAngle" => 5,
                //     "minWindSpeed" => 0.1,
                //     "maxWindSpeed" => 3,
                //     "minPeopleNum" => 0,
                //     "maxPeopleNum" => 20,
                // ];
                $body[] = [
                    "creanceId" => (string) $data['eid'],
                    "deviceId" => (string) $data['eid'],
                    "deviceName" => (string) $data['eid'],
                    "recDate" => date('Y-m-d H:i:s', time()),
                    "liftLoad" => $data['weight'],
                    "height" => $data['height'],
                    "speed" => $data['speed'],
                    "angle" => $data['tilt_x'],
                    "windSpeed" => $data['wind_speed'],
                    "peopleNum" => $data['number'],
                    "floor" => 0,
                ];
                $send['body'] = $body;
                $send_json = json_encode($body);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($send_json, 'ForwardController228');
                // Log::write($stringBody, 'ForwardController228');
                break;
            case 113:
                //李珊珊--洛阳
                // $url = 'http://api.1357.cn/hz-aiot-towercrane/api/open/tower/saveTowerParamData';
                $url = 'http://api.1357.cn/hz-aiot-towercrane/api/open/tower/saveTowerRealData';
                $appId = '6182503014997891003';
                $appSecret = '841614df990649926869b2b2d3a4f8682fa41392';
                // $send = [
                //     "deviceSn"=> $param['eid'],
                //     "base"=> 1,
                //     "coordX"=> 1,
                //     "coordY"=> 1,
                //     "foreArmLength"=> 50,
                //     "postArmLength"=> 12,
                //     "hatHeight"=> 1,
                //     "overload"=> 4,
                //     "remotePullRod"=> 1,
                //     "nearPullRod"=> 1,
                //     "postPullRod"=> 1,
                //     "downHeight"=> 30,
                //     "towCraneId"=> 1,
                //     "baseGaoChen"=> 1,
                //     "towCranePeakType"=> 1,
                //     "updateTime"=> time()*1000,
                // ];
                $send[] = [
                    "id" => time() * 1000,
                    "deviceSn" => $param['eid'],
                    "sampleTime" => time() * 1000,
                    "weight" => $param['weight'],
                    "tiltX" => $param['angle_x'],
                    "tiltY" => $param['angle_y'],
                    "windSpeed" => $param['wind_speed'],
                    "height" => $param['height'],
                    "fudu" => $param['amplitude'],
                    "yangjiao" => $param['angle_y'],
                    "torque" => $param['moment_percent'],
                    "angle" => $param['round'],
                    "isAlarm" => 0,
                ];
                $send_json = json_encode($send);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                    'headers' => [
                        'appId' => $appId,
                        'appSecret' => $appSecret,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($send_json, 'ForwardController113');
                // Log::write($stringBody, 'ForwardController113');
                break;
            case 114:
                //工汇智慧工地
                $url = 'http://ywzh.gongfupay.com:9993';
                $appKey = 'ca4tOWWU';
                $appSecret = '7QptZ0fyBjTFvTMecJzZ1nqmgowqrut5';
                $api = '/third/token/get';
                $time = date('YmdHis', time());
                $sign = md5($appKey . $time . $appSecret);
                $send = [
                    "appKey" => $appKey,
                    "sign" => $sign,
                    "time" => $time,
                ];
                $client = new Client;
                $response = $client->request('POST', $url . $api, [
                    'form_params' => $send,
                ])->getBody();
                $token = json_decode($response)->result->token;

                $send = [
                    "sn" => $param['eid'],
                    "CollectionTime" => date('Y-m-d H:i:s', time()),
                    "Angle" => "25",
                    "Radius" => "5",
                    "LoadData" => "5",
                    "Safeload" => "3",
                    "MomentPercent" => "71",
                    "Speed" => "5",
                    "Height" => "8.14",
                    "Floor" => "2",
                    "ObliguityX" => "4.44",
                    "ObliguityY" => "2.89",
                    "WindSpeed" => "6.85",
                    "ObliqueAngle" => "4.92",
                    "ObliqueDirection" => "8.47",
                    "Fall" => "25",
                    "WindLevel" => "6",
                ];
                $send_json = json_encode($send);
                $api = '/third/crane/data/sync';
                $client = new Client;
                $response = $client->request('POST', $url . $api, [
                    'json' => $send,
                    'headers' => [
                        'token' => $token,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($send_json, 'ForwardController114');
                // Log::write($stringBody, 'ForwardController114');
                break;
            case 115:
                $data = $param;
                //江苏麦科斯
                if (Cache::has('CASE_115')) {
                    $token = Cache::get('CASE_115');
                } else {
                    $token_body = [
                        "username" => "zhongxiangshebei",
                        "password" => "max20231007",
                    ];

                    $client = new Client;
                    $response = $client->request('POST', 'http://119.3.93.77:7308/center/users/login', [
                        'json' => $token_body,
                    ])->getBody();
                    $stringBody = (string) $response;
                    $token = json_decode($stringBody)->data->token;
                    Cache::set('CASE_115', $token, 14400);
                }
                $url = 'http://119.3.93.77:7308/device-server/dataReceive/getTowerData';
                $send = [
                    "deviceNo" => (int) $data['eid'],
                    "brand" => '5',
                    "load" => (string) $data['weight'],
                    "radius" => (string) $data['amplitude'],
                    "percent" => (string) $data['moment_percent'],
                    "angle" => (string) $data['round'],
                    "height" => (string) $data['height'],
                    "windSpeed" => (string) $data['wind_speed'],
                    "safeLoad" => '5.0',
                    "fall" => "2",
                    "obliqueDirection" => '1',
                    "obliqueAngle" => (string) $data['angle_x'],
                    "deviceTime" => date('Y-m-d H:i:s', time()),
                    "createTime" => date('Y-m-d H:i:s', time()),
                    "idCard" => '0',
                    "obliqueState" => 0,
                    "isCollisionAlarm" => 0,
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                    'headers' => [
                        'token' => $token,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($send, 'ForwardController115');
                // Log::write($stringBody, 'ForwardController115');
                break;
            case 229:
                //赵磊--湖北易通智联--升降机
                $host = 'https://www.etone.online/';
                $api = 'api/elevator/';
                // $api = 'api/sendBaseData/'; //参数上报

                $token_send = [
                    'userName' => 'shandongtanyue',
                    'passWord' => 'et@20230608.',
                ];
                $client = new Client;
                $response = $client->request('POST', 'https://www.etone.online/api/login/', [
                    'form_params' => $token_send,
                ])->getBody();
                $stringBody = (string) $response;
                $token = json_decode($stringBody)->token;
                $id = json_decode($stringBody)->id;
                $dtu_arr = [
                    23090249 => 'YTZL-2023-5028',
                    23090226 => 'YTZL-2023-5029',
                    23090264 => 'YTZL-2023-5031',
                ];
                $dtu = $dtu_arr[$param['eid']];
                /* 数据 */
                $data[] = [
                    "sys_time" => time(),
                    "crane_load" => $param['weight'],
                    "height" => $param['height'],
                    "floor" => 0,
                    "speed" => $param['speed'],
                    "load_alarm" => 0,
                    "speed_alarm" => 0,
                    "front_door_lock_alarm" => 0,
                    "rear_door_lock_alarm" => 0,
                    "upper_limit_alarm" => 0,
                    "down_limit_alarm" => 0,
                    "upper_limit_alarm01" => 0,
                    "down_limit_alarm01" => 0,
                    "upper_deceleration_alarm" => 0,
                    "down_deceleration_alarm" => 0,
                    "authentication" => 0,
                    "front_door_lock_state" => 0,
                    "rear_door_lock_state" => 0,
                    "upper_limit_state" => 0,
                    "down_limit_state" => 0,
                    "upper_limit_state01" => 0,
                    "down_limit_state01" => 0,
                    "upper_deceleration_state" => 0,
                    "down_deceleration_state" => 0,
                    "wind_speed" => $param['wind_speed'],
                    "levelX" => $param['tilt_x'],
                    "levelY" => $param['tilt_y'],
                    "sys_state" => $param['run_status'],
                    "hoisting_limit" => 0,
                    "falling_limit" => 0,
                    "wind_warning" => 0,
                    "wind_alarm" => 0,
                    "levelX_warning" => 0,
                    "levelX_alarm" => 0,
                    "levelY_warning" => 0,
                    "levelY_alarm" => 0,
                    "wind_level" => 0,
                    "total_people" => $param['number'],
                    "head" => 0,
                    "cap" => 0,
                ];
                // $data[] = [
                //     "sys_time"=> time(),
                //     "dev_type"=> 3,
                //     "upper_max_height"=> 100,
                //     "max_weight"=> 1000,
                //     "warning_weight"=> 900,
                //     "warning_wind"=> 6,
                //     "alarm_wind"=> 7,
                //     "warning_levelX"=> 10.00,
                //     "alarm_levelX"=> 15.00,
                //     "warning_levelY"=> 10.00,
                //     "alarm_levelY"=> 15.00,
                //     "upper_limit_height"=> 98,
                //     "upper_deceleration_height"=> 95,
                //     "down_limit_height"=> 3,
                //     "down_deceleration_height"=> 6,
                //     "down_max_height"=> 0,
                //     "warning_speed"=> 8.00,
                //     "alarm_speed"=> 10.00,
                //     "people_number_warning"=> 9,
                //     "people_number_alarm"=> 10
                // ];
                $send = [
                    "name" => "123",
                    "cname" => "123",
                    "token" => $token,
                    "dtu" => $dtu,
                    "frameType" => 16, //实时数据
                    // "frameType" => 2,//参数上报
                    "id" => $id,
                    "datas" => $data,
                ];
                $send_json = json_encode($send);
                $url = $host . $api;
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($send_json, 'ForwardController229');
                Log::write($stringBody, 'ForwardController229');
                break;
            case 230:
                //深圳一指通升降机
                $url = 'https://zhgd.hwgc.cn:8050/iot-web/api/chm/sendReport';
                /* 数据 */
                $data = [
                    "SN" => $param['eid'],
                    "CycleId" => 0,
                    "ICCard" => 0,
                    "Rtc" => date('Y-m-d H:i:s', time()),
                    "Heavy" => $param['weight'],
                    "RatedWeight" => 8000,
                    "Height" => $param['height'],
                    "Speed" => $param['speed'],
                    "Floors" => 0,
                    "PersonNum" => $param['number'],
                    "SensorState" => 0000000000000000,
                    "AlertFlag" => 0,
                    "RelayStatus" => 0,
                    "GprsSignal" => 0,
                    "CurScreen" => 0,
                    "WindLevel" => 0,
                    "WindSpeed" => $param['wind_speed'],
                    "AngleX" => $param['tilt_x'],
                    "AngleY" => $param['tilt_y'],
                ];
                $send = [
                    "sendcompany" => "LN",
                    "acceptcompany" => "ZHHX",
                    "operation_type" => "Current",
                    "data_body" => $data,
                ];
                $send_json = json_encode($send);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($send_json, 'ForwardController230');
                // Log::write($stringBody, 'ForwardController230');
                break;
            case 231:
                //江苏科盛轩逸
                $token = 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxNzIsInVzZXJfa2V5IjoiMjI3ZjliYjQtZTgzNi00ZTY1LTlkN2EtZDFiZjk2MGJjMTZmIiwidXNlcm5hbWUiOiJzaGFuZG9uZ3Rhbnl1ZSJ9.ysHIoOZx-Z_ylsqbfyEzpvdiN9r3qBL9xQnRfCcHJqRLb9z8QWSFtbqgLaK-Ex9oYdlHGgi9tCHTnqKxG_MT8g';
                $host = 'http://gateway.jsske.com/';
                $api = 'reception/lift/realtimeInfo';
                $url = $host . $api;
                $faultSignal = [
                    "peopleSensor" => 0,
                    "driverManage" => 0,
                    "speedSensor" => 0,
                    "loadSensor" => 0,
                    "floorCall" => 0,
                    "lockCarFailed" => 0,
                ];
                $operationSignal = [
                    "bottomCageProtect" => 0,
                    "serviceChamber" => 0,
                    "masterSwitch" => 0,
                    "liftingCageInStock" => 0,
                    "liftingCageOutStock" => 0,
                    "liftingCageProof" => 0,
                    "start" => 0,
                    "up" => 0,
                    "down" => 0,
                    "floorDoorSafe" => 0,
                    "knotButton" => 0,
                ];
                $alarmStatus = [
                    "load" => 0,
                    "offSet" => 0,
                    "height" => 0,
                    "speed" => 0,
                    "peopleCount" => 0,
                    "lean" => 0,
                    "frontDoor" => 0,
                    "backDoor" => 0,
                    "windSpeed" => 0,
                    "illegalDriverAlarm" => 0,
                ];
                $lockStatus = [
                    "frontDoor" => $param['front_door_status'],
                    "backDoor" => $param['back_door_status'],
                    "lockWorkStatus" => 0,
                ];
                $eventMsg = [
                    "deviceNo" => $param['eid'],
                    "source" => 510004,
                    "timestamp" => time() * 1000,
                    "number" => $param['eid'],
                    "load" => $param['weight'],
                    "loadPercent" => 0,
                    "peopleCount" => $param['number'],
                    "speed" => $param['speed'],
                    "direction" => $param['run_status'],
                    "height" => $param['height'],
                    "heightPercent" => 0,
                    "leanGradient1" => $param['tilt_x'],
                    "leanGradientPercent1" => 0,
                    "leanGradient2" => $param['tilt_y'],
                    "leanGradientPercent2" => 0,
                    "driverIdentifyStatus" => 1,
                    "windSpeed" => $param['wind_speed'],
                    "lockStatus" => $lockStatus,
                    "alarmStatus" => $alarmStatus,
                    "operationSignal" => $operationSignal,
                    "faultSignal" => $faultSignal,
                ];
                $send = [
                    "eventGuid" => '1DE2C0E055434505BE36A1B494FEE1D9',
                    "eventCode" => 112002,
                    "eventMsg" => $eventMsg,
                ];
                $send_json = json_encode($send);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                    'headers' => [
                        'Authorization' => 'Bearer ' . $token,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($send_json, 'ForwardController231');
                Log::write($stringBody, 'ForwardController231');
                break;
            case 232:
                //江苏傲之途
                $url = 'http://device.aozhitu.cn:8000/api/device/deviceLifters/current';
                $url_basic = 'http://device.aozhitu.cn:8000/api/device/deviceLifters/basic';
                $url_deviceLifterPeopleNums = 'http://device.aozhitu.cn:8000/api/device/deviceLifterPeopleNums';

                $secretId = 'W5nzlv5VLYIuDllY5MzaMploLEQTFVPTuYYf';
                $secretKey = 'xDcfbj9KervlVwee8rHvpvMQqv0g5ROzMV65';
                $Timestamp = time() * 1000;
                $Nonce = rand(10000, 99999);
                $str = 'SecretId=' . $secretId . '&X-Nonce=' . $Nonce . '&X-Timestamp=' . $Timestamp;
                $hash_hmac = base64_encode(hash_hmac("sha1", $str, $secretKey, true));
                $data = $param;
                $send = [
                    "sn" => $data['eid'],
                    "punchTime" => date('Y-m-d H:i:s', time()),
                    "date" => date('Y-m-d H:i:s', time()),
                    "weight" => $data['weight'],
                    "weightPercent" => 0,
                    "driverName" => "NULL",
                    "height" => $data['height'],
                    "percent1" => 0,
                    "percent2" => 0,
                    "driverNum" => $data['number'],
                    "lockState" => "CLOSE",
                    "alarmLevel" => "NORMAL",
                    "gradient1" => round($data['tilt_x'], 2),
                    "gradient2" => round($data['tilt_y'], 2),
                    "heightPercent" => 0,
                    "alarmReason" => " ",
                    "speed" => round($data['speed'], 2),
                ];
                $send_basic = [
                    "sn" => $data['eid'],
                    "latitude" => 0,
                    "longitude" => 0,
                    "maxSpeedAlarm" => 10,
                    "maxSpeedWarn" => 15,
                    "tiltWarn" => 2,
                    "tiltAlarm" => 71,
                    "maxHeight" => 100,
                    "maxNumber" => 8,
                    "date" => date('Y-m-d H:i:s', time()),
                    "maxWeightAlarm" => 1.8,
                    "maxWeightWarn" => 2.0,
                ];
                $send_deviceLifterPeopleNums = [
                    "sn" => $data['eid'],
                    "num" => $data['number'],
                    "date" => date('Y-m-d H:i:s', time()),
                ];
                $json = json_encode($send);
                $send_json = json_encode($send);
                $send_deviceLifterPeopleNums_json = json_encode($send_deviceLifterPeopleNums);
                $header = [
                    'X-Timestamp' => $Timestamp,
                    'X-Nonce' => $Nonce,
                    'SecretId' => $secretId,
                    'X-Signature' => $hash_hmac,
                    'Sn' => $data['eid'],
                ];
                $client = new Client;
                /* url_basic send_basic url_deviceLifterPeopleNums send_deviceLifterPeopleNums*/
                $response = $client->request('POST', $url, [
                    'json' => $send,
                    'headers' => $header,
                ])->getBody();

                Log::write($header, 'ForwardController232');
                Log::write($send_deviceLifterPeopleNums_json, 'ForwardController232');

                $response_deviceLifterPeopleNums = $client->request('POST', $url_deviceLifterPeopleNums, [
                    'json' => $send_deviceLifterPeopleNums,
                    'headers' => $header,
                ])->getBody();

                $stringBody = (string) $response;
                $stringBody_deviceLifterPeopleNums = (string) $response_deviceLifterPeopleNums;

                Log::write($stringBody_deviceLifterPeopleNums, 'ForwardController232');
                // Log::write($send_json, 'ForwardController232');
                // Log::write($stringBody, 'ForwardController232');
                break;
            case 233:
                //孝南高新园区安置房项目round($param['weight'] / 1000, 2),
                $url = 'http://47.94.245.234:9091/api/device/data/towerCrane';
                $data = [
                    "driverName" => "111",
                    "idcardNumber" => "111",
                    "liftingCapacity" => round($param['weight'], 1),
                    "momentForce" => round($param['moment'], 1),
                    "windSpeed" => round($param['wind_speed'], 1),
                    "amplitude" => round($param['amplitude'], 1),
                    "round" => round($param['round'], 1),
                    "height" => round($param['height'], 1),
                    "dipAngle" => round($param['angle_y'], 1),
                    "recordTime" => date('Y-m-d H:i:s', time()),
                ];
                $send = [
                    "deviceSn" => $param['eid'],
                    "deviceType" => 2,
                    "data" => $data,
                ];
                $json = json_encode($send);
                $send_json = json_encode($send);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                    'headers' => [
                        'token' => 'b07a9945e0e74c1a97986df3e50665f8',
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($send_json, 'ForwardController233');
                Log::write($stringBody, 'ForwardController233');
                break;
            case 116:
                //JD金铎塔机数据对接
                $url = 'http://111.15.167.74:8002/api/iot/reportApi/td/receiveLiveData';
                if ($param['weight'] < 0) {
                    $param['weight'] = 0;
                }
                $angle = mt_rand(-100, 100) / 100;
                $send = [
                    "deviceCode" => $param['eid'],
                    "relayStatus" => "00000000",
                    "range" => $param['amplitude'],
                    "height" => $param['height'],
                    "windSpeed" => $param['wind_speed'],
                    "beaufortScale" => 0,
                    "liftWeight" => $param['weight'],
                    "moment" => $param['moment'],
                    "loadRatio" => 0,
                    "corner" => $param['round'],
                    "angle" => $angle,
                    "slewingStatus" => "0",
                    "hoistingStatus" => "0",
                    "rope" => "0",
                    "tiltPercent" => "0",
                    "torquePercent" => "0",
                    "wightPercent" => "0",
                    "windSpeedPercent" => "0",
                    "recordTimeStr" => date('Y-m-d H:i:s', time()),
                ];
                $json = json_encode($send);

                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($json, 'ForwardController116');
                Log::write($stringBody, 'ForwardController116');
                break;
            case 117:
                //碧桂园凤凰星宸-老于
                $url = 'http://222.133.41.47:8090/XHTAPI/api/ZHGD_API';
                /* 数据 */
                $paramJsonData = [
                    "DeviceNo" => (int) $param['eid'],
                    // "SN"=> "135XXXXXX",
                    "Amplitude" => $param['amplitude'],
                    "Angle" => $param['angle_x'],
                    "ArmHeight" => 34,
                    "ForeArmLength" => 50,
                    "Height" => $param['height'],
                    "Weight" => $param['weight'],
                    "Windspeed" => $param['wind_speed'],
                    "Rotation" => $param['round'],
                    "MaxLoad" => 4,
                    "SafeLoad" => 4,
                    "RatedTorque" => 95,
                    // "LocationX"=> "123.6",
                    // "LocationY"=> "114.5",
                    "AL_ForbiddenZone" => "0",
                    "AL_HardwareFault" => "0",
                    "AL_Incline" => "0",
                    "AL_Limit" => "0",
                    "AL_Load" => "0",
                    "AL_ObstacleCollision" => "0",
                    "AL_Torque" => "0",
                    "AL_TowerCollision" => "0",
                    "AL_Windspeed" => "0",
                    "Time" => date('Y-m-d H:i:s', time()),
                    "Remarks" => "",
                ];
                $send = [
                    "ApiKey" => 'da2c9325-0b32-4805-8e90-8317cea99484',
                    "FunctionName" => 'Xht_TJDateRecFac',
                    "paramJsonData" => $paramJsonData,
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($send, 'ForwardController117');
                Log::write($stringBody, 'ForwardController117');
                break;
            case 118:
                //苏州信拓业 --袁燚燚   合木探越对接尹尧
                $url = 'http://123.60.57.233:8082/ayy/api/tower';
                $send = [
                    "deviceId" => $param['eid'],
                    "limitWeight" => 5.0,
                    // "weight" => round($param['weight'] / 1000, 2),
                    "weight" => $param['weight'],
                    "limitHeight" => 50.0,
                    "height" => round($param['height'], 2),
                    "limitMagnitude" => 50.0,
                    "magnitude" => round($param['amplitude'], 2),
                    "limitTorque" => 8,
                    "Torque" => round($param['moment'], 2),
                    "torquePercentage" => round($param['moment_percent'], 2),
                    "rotation" => round($param['round'], 2),
                    "windSpeed" => round($param['wind_speed'], 2),
                    "dipAngle" => round($param['angle_x'], 2),
                    "weightSensorStatus" => 0,
                    "torqueSensorStatus" => 0,
                    "heightSensorStatus" => 0,
                    "magnitudeSensorStatus" => 0,
                    "isWeightAlarm" => 0,
                    "isTorqueAlarm" => 0,
                    "isHeightAlarm" => 0,
                    "isMagnitudeAlarm" => 0,
                    "isRotationAlarm" => 0,
                    "isCollisionAlarm" => 0,
                    "isAreaLimitAlarm" => 0,
                    "isWindSpeedAlarm" => 0,
                    "isDipAngleAlarm" => 0,
                    "isAuthorization" => 0,
                    "isPower" => 0,
                    "sendTime" => date('Y-m-d H:i:s', time()),
                ];
                $json = json_encode($send);

                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($json, 'ForwardController118');
                Log::write($stringBody, 'ForwardController118');
                if($param['eid']==13101348 || $param['eid']==13101350){
                    goto case122;
                }

                break;
            case 119:
                //重庆筑云 --小袁
                $data = $param;
                $url = 'https://iot.bimcc.net/api/accept/crane';
                $sourceId = '9b2db993-857f-11e7-857d-00163e32d704';
                $send = [[
                    'sourceId' => $sourceId,
                    'registNo' => $data['eid'],
                    'serialNo' => $data['eid'],
                    'recordTime' => date('Y-m-d H:i:s', time()),
                    'angle' => $data['round'],
                    'radius' => $data['amplitude'],
                    'height' => $data['height'],
                    'load' => $data['weight'],
                    'safeLoad' => 3,
                    'percent' => $data['moment_percent'],
                    'windSpeed' => $data['wind_speed'],
                    'obliquity' => $data['angle_x'],
                    'dirAngle' => $data['angle_y'],
                    'fall' => 2,
                    'status' => "0",
                    'message' => null,
                ]];
                $json = json_encode($send);

                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($json, 'ForwardController119');
                Log::write($stringBody, 'ForwardController119');
                break;
            case 234:
                //张姐-烟台客户-新点-升降机-开发区
                $url = 'https://kfqzhgd.yeda.gov.cn/IOTWebService2.0/rest/ElevatorDataService/PushRealTimeInfo';
                $Authorization = 'Bearer 59b521a35172a6b5740226bdd9bbea97';
                if ($param['eid'] == '23080206' || $param['eid'] == '23090239' || $param['eid'] == '23090242' || $param['eid'] == '23080205' || $param['eid'] == '23100313' || $param['eid'] == '23100285' || $param['eid'] == '23100289' || $param['eid'] == '23100312' || $param['eid'] == '23100303' || $param['eid'] == '23100287' || $param['eid'] == '23100295' || $param['eid'] == '23100307' || $param['eid'] == '23100277' || $param['eid'] == '23100290' || $param['eid'] == '23110333' || $param['eid'] == '23110339' || $param['eid'] == '23110318' || $param['eid'] == '23110332' || $param['eid'] == '23110354' || $param['eid'] == '23110365' || $param['eid'] == '23110316' || $param['eid'] == '23110337') {
                    $unifiedProjectCode = 'e7a26e86-c000-462c-b5e0-fafe54c30385';
                }
                $send['params'] = [
                    "unifiedProjectCode" => $unifiedProjectCode,
                    "dataTimeStamp" => time() * 1000,
                    "deviceFactory" => "sdty",
                    "protocolVer" => "protocolVer",
                    "deviceSN" => $param['eid'],
                    "deviceTCPIP" => "127.0.0.1",
                    "deviceTCPPoot" => "0",
                    "date" => date('Y-m-d', time()),
                    "time" => date('H:i:s', time()),
                    "operaterNo" => "0",
                    "name" => '111',
                    "idNo" => '111',
                    "workStatus" => "0",
                    "motorStatus" => "0",
                    "multiple" => 2,
                    "realtimePeople" => $param['number'],
                    "realtimeWeight" => $param['weight'],
                    "realtimeSpeed" => $param['speed'],
                    "realtimeHeight" => $param['height'],
                    "realtimeFloor" => 0,
                    "realtimeDipX" => $param['tilt_x'],
                    "realtimeDipY" => $param['tilt_y'],
                    "realtimeWindSpeed" => $param['wind_speed'],
                    "realtimeWindLevel" => 1,
                    "obliguityXAlarm" => "0",
                    "obliguityYAlarm" => "0",
                    "windSpeedAlarm" => "0",
                    "limitAlarm" => "0",
                    "antiDropAlarmt" => "0",
                    "outDoorStatus" => "0",
                    "heightAlarm" => "0",
                    "speedAlarm" => "0",
                    "weightPreAlarm" => "0",
                    "speedPreAlarm" => "0",
                    "heightPreAlarm" => "0",
                    "obliguityXPreAlarm" => "0",
                    "obliguityYPreAlarm" => "0",
                    "windSpeedPreAlarm" => "0",
                    "peopleAlarm" => "0",
                    "weightAlarm" => "0",
                    "noError" => "0",
                    "peopleCntSetError" => "0",
                    "speedError" => "0",
                    "floorSetError" => "0",
                    "obliguityXError" => "0",
                    "obliguityYError" => "0",
                    "weightError" => "0",
                    "windSpeedSetError" => "0",
                    "wirelessSetError" => "0",
                    "noPreAlarm" => "0",
                    "rangeError" => "0",
                    "heightError" => "0",
                    "angleError" => "0",
                    "obliguityError" => "0",
                    "gpsError" => "0",
                    "idError" => "0",
                    "noAlarm" => "0",
                    "momentAlarm" => "0",
                    "windSpeedAlarm" => "0",
                    "heightAlarm" => "0",
                    "minRangeAlarm" => "0",
                    "maxRangeAlarm" => "0",
                    "posAngleAlarm" => "0",
                    "negAngleAlarm" => "0",
                    "obliguityAlarm" => "0",
                    "forbidEntryAlarm" => "0",
                    "forbidSuspend2Alarm" => "0",
                    "forbidSuspend4Alarm" => "0",
                    "otherField" => "",
                ];
                //-----未提供
                $send['params'] = json_encode($send['params']);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'form_params' => $send,
                    'headers' => [
                        'Authorization' => $Authorization,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($stringBody, 'ForwardController234');
                break;
            case 235:
                //石首市-升降机实时数据
                $url = '122.189.98.132:11009/smart-cloud/api/v1/reportDeviceLift/deviceLift';
                // $url = '122.189.98.132:11009/smart-cloud/api/v1/reportDeviceLiftBase/deviceLiftBase';//基础数据
                $token = '95c2e466-54d5-49b2-8151-7dfcc4aa2cb0';
                $send['token'] = $token;
                $send['body'][] = [
                    "creanceId" => (string) $param['eid'],
                    "deviceId" => (string) $param['eid'],
                    "deviceName" => (string) $param['eid'],
                    "recDate" => date('Y-m-d H:i:s', time()),
                    "liftLoad" => $param['weight'],
                    "height" => $param['height'],
                    "speed" => $param['speed'],
                    "angle" => $param['tilt_x'],
                    "windSpeed" => $param['wind_speed'],
                    "peopleNum" => $param['number'],
                ];
                // $send['body'][] = [
                //     "creanceId" => (string) $param['eid'],
                //     "deviceId" => (string) $param['eid'],
                //     "deviceName" => (string) $param['eid'],
                //     "recDate" => date('Y-m-d H:i:s', time()),
                //     "minHeight" => 0,
                //     "maxHeight" => 60,
                //     "minFloor" => -3,
                //     "maxFloor" => 20,
                //     "minSpeed" => 0,
                //     "maxSpeed" => 10,
                //     "minWindSpeed" => 0,
                //     "maxWindSpeed" => 10.8,
                //     "minPeopleNum" => 0,
                //     "maxPeopleNum" => 8,
                // ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($send, 'ForwardController235');
                Log::write($stringBody, 'ForwardController235');
                break;
            case 120:
                //福建测试
                $url = '101.133.149.245:9999/api/v1/hardware/TowerRealData';
                unset($param['forward_id'], $param['id'], $param['issued_control'], $param['create_time'], $param["update_time"], $param["other"], $param["remark"]);
                $client = new Client;
                $param['eid'] = (int) $param['eid'];
                $response = $client->request('POST', $url, [
                    'json' => $param,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($param, 'ForwardController_120');
                Log::write($stringBody, 'ForwardController_120');
                break;
            case 236:
                //福建测试
                $url = '101.133.149.245:9999/wd/lifter/addLift';
                unset($param['forward_id'], $param['id'], $param['issued_control'], $param['create_time'], $param["update_time"], $param["other"], $param["remark"]);
                $client = new Client;
                $param['eid'] = (int) $param['eid'];
                $response = $client->request('POST', $url, [
                    'json' => $param,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($param, 'ForwardController_236');
                Log::write($stringBody, 'ForwardController_236');
                break;
            case 121:
                if (Cache::has('CASE_121')) {
                    $token = Cache::get('CASE_121');
                } else {
                    $client = new Client;
                    $response = $client->request('GET', 'https://wisdom.lezhu.shop/wisdom_supervise/supervise/huaKongData/getToken?clientName=1701046542149&clientKey=KQYQw8L3OcsuXWfWq1mbkgG/v6i/ucgoo2EAB0FuNZU=')->getBody();
                    $stringBody = (string) $response;
                    $token = json_decode($stringBody)->data;
                    Cache::set('CASE_121', $token, 86400);
                }
                $url = 'https://wisdom.lezhu.shop/wisdom_supervise/foreign/towerCrane/addTowerCraneTimeData';
                $send = [
                    "bl" => '200',
                    "deviceId" => $param['eid'],
                    "driverIdCard" => '320301202001010101',
                    "driverName" => '张三',
                    "dz" => (string) $param['weight'],
                    "fd" => (string) $param['amplitude'],
                    "ljb" => (string) $param['moment_percent'],
                    "hz" => (string) $param['round'],
                    "height" => (string) $param['height'],
                    "qj" => (string) $param['angle_x'],
                    "jkDate" => date('Y-m-d H:i:s', time()),
                    "windspeed" => (string) $param['wind_speed'],
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                    'headers' => [
                        'token' => $token,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($send, 'ForwardController121');
                Log::write($stringBody, 'ForwardController121');
                break;
            case 122:
                case122:
                //合木
                $url = 'https://zhcs.zhnbxc.top:18090/admin-api/system/api/tower/monitoring';
                $send = [
                    "eid" => $param['eid'],
                    "height" => $param['height'],
                    "weight" => $param['weight'],
                    "round" => $param['round'],
                    "amplitude" => $param['amplitude'],
                    "windSpeed" => $param['wind_speed'],
                    "moment" => $param['amplitude'] * $param['weight'],
                    "momentPercent" => $param['moment_percent'],
                    "override" => $param['override'],
                    "angleX" => $param['angle_x'],
                    "angleY" => $param['angle_y'],
                ];
                $client = new Client;
                $send['eid'] = (int) $param['eid'];
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($send, 'ForwardController_122');
                Log::write($stringBody, 'ForwardController_122');
                break;
            case 237:
                //安固士&探越塔吊升降机技术交流
                $url = 'https://openapi.anculsai.com:8004/open/api/v1/fse/lift/anon/tanyue/realData';
                unset($param['forward_id'], $param['id'], $param['issued_control'], $param['create_time'], $param["update_time"], $param["other"], $param["remark"]);
                $client = new Client;
                foreach ($param as $key => $value) {
                    $param[$key] = round($param[$key], 2);
                }
                $param['eid'] = (int) $param['eid'];
                $param['speed'] = $param['speed'] / 10;
                $response = $client->request('POST', $url, [
                    'json' => $param,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($param, 'ForwardController_237');
                Log::write($stringBody, 'ForwardController_237');
                break;
            case 123:
                //湖溪云镜
                $url = 'http://yzt.yztzn.com/yzt-zhgd';
                $appld = '4352f5e0e9c24bddba0e9461d2244274';
                $key = 'MIIBUgIBADANBgkqhkiG9w0BAQEFAASCATwwggE4AgEAAkEAixbcm2MbnTGyZw+arcIk7CjSIGEc8W6d6g/mqMj0o4o1i2U9xX4MHzpkYsRyelc2ydrxlD5kXPN1fxd6p3tqPQIDAQABAkAIRdHVRC3OSbhsvNbcYuHDUiI9XslT6tplo5B6lYlHeMhlIW+Dw5rFtAswYX4ewJMeTm93eB2vGffEv7Sdw1fBAiEA0rAcXXIjKmx3kGtCdJn/iPWq2a8ohnv+EpqDozqNGoUCIQCpALr5/cXla+j9+IOI9ZNR9S+VNV4IfMMFuBWoCxQKWQIfdAqLlOxIchVLxT9OWup20/h7IWpX57pjNdvkpQKatQIgJkiyEnt4XvZI+29WbKoky0Ydl1FVkdqhWyROU5je21ECIDHabPnBDyNAjoA55gu8FwlDtitCJNB8TSrC2At+tvKP';
                $api = '/zhgdCraneRecord/saveRecord';

                $time = time() * 1000;
                $aes_data = 'appid=' . $appld . '&systemTime=' . $time . '&uri=' . $api;
                $method = 'AES-128-ECB';

                $sign = openssl_encrypt($aes_data, $method, $key);

                $send = [
                    "devsn" => (int) $param['eid'],
                    "makeFactory" => "sdty",
                    "time" => date('Y-m-d H:i:s', time()),
                    "scope" => $param['amplitude'],
                    "height" => $param['height'],
                    "rotate" => $param['round'],
                    "oblique" => $param['angle_x'],
                    "ws" => $param['wind_speed'],
                    "rated_weight" => 67.9,
                    "momper" => $param['moment_percent'],
                    "weight" => $param['weight'],
                    "state" => 0,
                ];
                $client = new Client;
                $response = $client->request('POST', $url . $api, [
                    'json' => $send,
                    'headers' => [
                        'appid' => $appld,
                        'systemTime' => $time,
                        'sign' => $sign,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($send);
                Log::write($send_json, 'ForwardController123');
                Log::write($stringBody, 'ForwardController123');
                break;
            case 124:
                //算谷塔机监测
                $url = 'https://dyzhgd.sdrydzkj.com:8443/abutment/fytower';
                $ApiKey = '14a54c44-6f7b-41cb-912e-49831d1e7617';
                $send = [
                    "ts" => date('Y-m-d H:i:s', time()),
                    "projectName" => "",
                    "userName" => "",
                    "cardId" => "",
                    "warningType" => "0",
                    "deviceId" => (int) $param['eid'],
                    "towerHigh" => $param['height'],
                    "towerRange" => $param['amplitude'],
                    "towerhz" => $param['round'],
                    "towerLoad" => $param['weight'],
                    "towerDip" => $param['angle_x'],
                    "towerWeigh" => $param['moment'],
                    "towerMoment" => $param['moment_percent'],
                    "towerfs" => $param['wind_speed'],
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                    'headers' => [
                        'ApiKey' => $ApiKey,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($send);
                Log::write($send_json, 'ForwardController124');
                Log::write($stringBody, 'ForwardController124');
                break;
            case 125:
                //江西飞达
                $url = 'https://www.zhudayun.cn/app-api/outapi/real-time';
                $send = [
                    "terminalNumber" => 'TY' . $param['eid'],
                    "time" => date('Y-m-d H:i:s', time()),
                    "qzbLength" => 50,
                    "qzbHeight" => 100,
                    "workType" => 0,
                    "height" => $param['height'],
                    "fudu" => $param['amplitude'],
                    "hzJd" => $param['round'],
                    "weight" => $param['weight'],
                    "qj" => $param['angle_x'],
                    "dbYj" => $param['angle_y'],
                    "liju" => $param['moment'],
                    "fengsu" => $param['wind_speed'],
                    "beilv" => $param['override'],
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($send);
                // Log::write($send_json, 'ForwardController125');
                // Log::write($stringBody, 'ForwardController125');
                break;
            case 238:
                //殷平辉-烟台
                $url = 'https://api.tongzhuwang.com/tss/mechanicalEquipmentAccount/safetyLifterRealTimeData/add';
                $token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDYxNTA4MzUsInVzZXJuYW1lIjoicnpxeXp5eWx6eF9zamoifQ.LC0zDzJ-vKqwQrfwSl6W5kIJbWtmnIjQEGnYUFLx_vE';
                /*
                "elevator_load": 0,
                "front_door_status": 1,
                "back_door_status": 1,
                "top_door_status": 1,
                "run_status": 1
                 */
                $send = [
                    "deviceName" => $param['eid'],
                    "deviceNumber" => (int) $param['eid'],
                    "dipX" => $param['tilt_x'],
                    "dipY" => $param['tilt_y'],
                    "carryPeopleNumber" => $param['number'],
                    "height" => $param['height'],
                    "windSpeed" => $param['wind_speed'],
                    "deadWeight" => $param['weight'],
                    "carrySpeed" => $param['speed'],
                    "dateAndTime" => date('Y-m-d H:i:s', time()),
                    "tenantId" => 2756,
                ];
                $send_json = json_encode($send);

                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                    'headers' => [
                        'X-Access-Token' => $token,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($send_json, 'ForwardController238');
                Log::write($stringBody, 'ForwardController238');
                break;
            case 239:
                $host = 'http://47.94.245.234:9091/';
                $send = [
                    "deviceSn" => $param['eid'],
                    "deviceType" => 3,
                ];
                if (Cache::has('case_239')) {
                    $token = Cache::get('case_239');
                } else {
                    $api = 'api/device/token'; //token
                    $client = new Client;
                    $response = $client->request('POST', $host . $api, [
                        'json' => $send,
                        // 'headers' => [
                        //     'X-Access-Token' => $token,
                        // ],
                    ])->getBody();
                    $stringBody = (string) $response;
                    $token = json_decode($stringBody)->data->token;
                    Cache::set('case_239', $token, 3600);
                }
                if (Cache::has('case_239')) {
                    $token = Cache::get('case_239');
                } else {

                }
                $api = 'api/device/data/elevator'; //实时数据
                $send['data'] = [
                    "driverName" => "0",
                    "idcardNumber" => "0",
                    "recordTime" => date('Y-m-d H:i:s', time()),
                    "currentLoad" => $param['weight'],
                    "speed" => round($param['speed'], 1),
                    "height" => round($param['height'], 1),
                    "angleX" => round($param['tilt_x'], 1),
                    "angleY" => round($param['tilt_y'], 1),
                    "personCount" => $param['number'],
                    "frontLockState" => 1,
                    "backLockState" => 1,
                    "frontOpenState" => $param['front_door_status'],
                    "backOpenState" => $param['back_door_status'],
                    "speedDirection" => $param['run_status'],
                ];
                $client = new Client;
                $response = $client->request('POST', $host . $api, [
                    'json' => $send,
                    'headers' => [
                        'token' => $token,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($send, 'ForwardController239');
                // Log::write($stringBody, 'ForwardController239');
                break;
            case 126:
                //中房项目塔机-赵磊
                foreach ($param as $key => $value) {
                    $param[$key] = (float) $value;
                }
                /* 参数 */
                // $host = 'http://36.133.44.231:6002/';
                $host = 'http://ses.ccccltd.cn/iotcore/';
                $api = 'recorddata'; //实时数据
                // $api = 'statusdata'; //设备开机、关机请求
                // $app_key = 'svmhgq6t';
                // $app_secret = '7aoxylnuco6rb8aqyi7im3h4c68v00za7ov3q3etrkdgosz86ac37stt3v';
                $app_key = 'qXeBQfVeBguWONkE';
                $app_secret = 'jJUk5hzhB8MPmwJCfn9ByLZCccKj8QrC';
                $t = time();
                $imei = 'hnzt-' . $param['eid'];
                // $imei = $param['eid'];
                $device_type = 96;

                $signStr = $api . $app_key . $app_secret . $t;
                $strtolower = strtolower($signStr);
                $sign = hash("sha256", $strtolower);
                /* status */
                $statusdata['data'] = [
                    "timestamp" => $t,
                    "status" => 'online', //offline
                    // "status" => 'offline'//offline
                ];
                /* recorddata */
                $generic = new SendParam;
                $generic->wind = $param['wind_speed'];
                $generic->uptime = 0;
                $generic->totalupime = 0;
                $generic->cmd = [];
                $tower[] = [
                    "label" => "tower",
                    "angle" => $param['angle_x'],
                    "rotation" => $param['angle_x'],
                    "horizontal" => $param['angle_x'],
                    "vertical" => $param['angle_y'],
                    "gantry" => [
                        [
                            "label" => "gantry",
                            "moment" => $param['moment'],
                            "momentration" => $param['moment_percent'],
                            "travel" => $param['weight'],
                            "speed" => 0,
                            "hoist" => [
                                [
                                    "label" => "hoist",
                                    "height" => $param['height'],
                                    "slide" => 0,
                                    "weight" => $param['weight'],
                                    "brakecount" => 0,
                                    "slidetime" => 0,
                                    "limiter" => null,
                                ],
                            ],
                        ],
                    ],
                    "limiter" => null,
                ];
                $send = [
                    "version" => "0.1.0",
                    "timestamp" => $t * 1000,
                    "upload" => "data",
                    "WorkCircleIndex" => 0,
                    "generic" => $generic,
                    "tower" => $tower,
                ];
                $url = $host . $api . '?' . 'imei=' . $imei . '&device_type=' . $device_type . '&app_key=' . $app_key . '&t=' . $t . '&sign=' . $sign;
                $json = json_encode($send); //实时数据
                // $json = json_encode($statusdata);//上线
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($url, 'ForwardController126');
                Log::write($json, 'ForwardController126');
                Log::write($stringBody, 'ForwardController126');
                break;
            case 127:
                $token = Cache::get('CASE_127');
                //雄安滦雄科技
                $url = 'https://api.xagongdi.com/api/open/crane/save';
                $send = [
                    "token" => $token,
                    "serial" => $param['eid'],
                    "time" => date('Y-m-d H:i:s', time()),
                    "alarm" => "",
                    "amplitude" => $param['amplitude'],
                    "angleX" => $param['angle_x'],
                    "angleY" => $param['angle_y'],
                    "heavy" => $param['weight'],
                    "heavyRatio" => $param['moment_percent'],
                    "height" => $param['height'],
                    "rotary" => $param['round'],
                    "torque" => $param['moment'],
                    "torqueRatio" => $param['moment_percent'],
                    "sp" => $param['wind_speed'],
                    "powerStatus" => "",
                    "driverCard" => "",
                ];
                // $send = [
                //     "token"=> "9c6a37b9053416bffd090d3965005f51",
                //     "serial"=> "13121580",
                //     "alarm"=> "",
                //     "amplitude"=> "25",
                //     "angleX"=> "0.22",
                //     "angleY"=> "0",
                //     "heavy"=> "12",
                //     "heavyRatio"=> "28.2",
                //     "height"=> "0",
                //     "time"=> "2022-02-08 12:23:23",
                //     "rotary"=> "214",
                //     "torque"=> "324",
                //     "torqueRatio"=> "23.5",
                //     "sp"=> "1.2",
                //     "powerStatus"=> "",
                //     "driverCard"=> ""
                // ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($send);
                Log::write($send_json, 'ForwardController127');
                Log::write($stringBody, 'ForwardController127');
                break;
            case 128:
                //小袁-安快
                $url = 'http://123.60.57.233:8082/ayy/api/tower';
                $send = [
                    "deviceId" => $param['eid'],
                    "limitWeight" => 5,
                    "weight" => round($param['weight'] / 1000, 2),
                    "limitHeight" => 50,
                    "height" => round($param['height'], 2),
                    "limitMagnitude" => 50,
                    "magnitude" => round($param['amplitude'], 2),
                    "limitTorque" => 50,
                    "Torque" => round($param['moment'], 2),
                    "torquePercentage" => round($param['moment_percent'], 2),
                    "rotation" => round($param['round'], 2),
                    "windSpeed" => round($param['wind_speed'], 2),
                    "dipAngle" => round($param['angle_x'], 2),
                    "weightSensorStatus" => 0,
                    "torqueSensorStatus" => 0,
                    "heightSensorStatus" => 0,
                    "magnitudeSensorStatus" => 0,
                    "isWeightAlarm" => 0,
                    "isTorqueAlarm" => 0,
                    "isHeightAlarm" => 0,
                    "isMagnitudeAlarm" => 0,
                    "isRotationAlarm" => 0,
                    "isCollisionAlarm" => 0,
                    "isAreaLimitAlarm" => 0,
                    "isWindSpeedAlarm" => 0,
                    "isDipAngleAlarm" => 0,
                    "isAuthorization" => 0,
                    "isPower" => 0,
                    // "datetime" => date('Y-m-d H:i:s', time()),
                    "sendTime" => date('Y-m-d H:i:s', time()),
                ];
                // $send = json_encode($data_send);
                // $response = Http::withHeaders([
                //     'Content-type' => 'application/json',
                // ])->post($url, $send)->body();
                // Log::channel('tower')->debug($send);
                // Log::channel('tower')->debug($response);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($send);
                Log::write($send_json, 'ForwardController128');
                Log::write($stringBody, 'ForwardController128');
                break;
            case 129:
                $appId = '7dac4fec-0ad7-4a20-96e4-a6b82c729109';
                // if ($param['eid'] == 14011619 ||$param['eid'] == 13050631) {
                if ($param['eid'] == 14011619) {
                    $outDeviceId = '44F5B201-D638-BB93-C967-472E43CE3EF9';
                    $appSecret = '3830A47B-2BC5-485B-B241-40D92910AE31';
                    $towerHeight = 53;
                    $coordinateX = '220';
                    $coordinateY = '217';
                }
                if ($param['eid'] == 13050767) {
                    $outDeviceId = '45F39B14-98C3-430D-34C0-707BF3DF796C';
                    $appSecret = '88DF8EB9-EDF3-4EAF-8E4F-20DE8F717F34';
                    $towerHeight = 62;
                    $coordinateX = '239';
                    $coordinateY = '266';
                }
                // if ($param['eid'] == 12110094 || $param['eid'] == 13020336) {
                if ($param['eid'] == 12110094) {
                    $outDeviceId = 'DFDA37F4-56E4-C027-93EB-7CD294DA6E4E';
                    $appSecret = '08749463-7333-4774-A6DE-2FC741DF88CB';
                    $towerHeight = 35;
                    $coordinateX = '309';//88997.988534
                    $coordinateY = '214';//51044.594281
                }
                if ($param['eid'] == 12090034) {
                    $outDeviceId = '8A6A6175-5686-D554-3745-ED0825FB85DC';
                    $appSecret = '21046215-D810-4EB7-929A-E2CF481193E5';
                    $towerHeight = 35;
                    $coordinateX = '168';
                    $coordinateY = '226';
                }
                $url = 'https://api.jizhibao.com.cn/iot/message/td/push';
                $numbers = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0];  
                $randomKey = array_rand($numbers);  
                // 输出随机选中的数字  
                $weight=$numbers[$randomKey];  
                $dipAngle_numbers = [2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5,3.7,3.8];  
                $dipAngle_randomKey = array_rand($dipAngle_numbers);  
                // 输出随机选中的数字  
                $dipAngle=$numbers[$randomKey];  

                $list = new SendParam;
                $list->outId = $outDeviceId;
                $list->outDeviceId = $outDeviceId;
                $list->towerHeight = $towerHeight;
                $list->coordinateX = $coordinateX;
                $list->coordinateY = $coordinateY;
                $list->rate = 2;
                $list->height = $param['height'];
                $list->range = $param['amplitude'];
                $list->rotation = $param['round'];
                $list->weight = $weight;//重量 临时推送数据
                $list->moment = $param['moment'];
                $list->windSpeed = 0;
                $list->fftcState = 1;
                // $list->dipAngle = $param['angle_x'];
                $list->dipAngle = $dipAngle;
                $list->dataTime = date('Y-m-d H:i:s', time());

                // $list = json_encode($list);
                $send = [
                    "list" => [$list],
                    "appId" => $appId,
                    // "appId" => '1af6f0f0-9467-4397-a395-e7e5eb25fc72',
                    "appSecret" => $appSecret,
                    // "appSecret" => '2156bee1-b7e4-4ccb-b84f-7a6a7dd094d7',
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($send);
                Log::write($send_json, 'ForwardController129');
                Log::write($stringBody, 'ForwardController129');
                break;
            case 241:
                $appId = '41d817bf-aedc-40e1-9d1b-3e8a237faedb';
                if ($param['eid'] == 23120471) {
                    $outDeviceId = '01350C8E-2BC0-56E9-08E0-F850472384B9';
                    $appSecret = 'F8081E38-D256-42ED-8FDE-94CC2D57AD21';
                }
                if ($param['eid'] == 23120482) {
                    $outDeviceId = '74E21EDB-48EA-39E0-DFD4-D4819D1A4B9F';
                    $appSecret = 'EB56D1CC-2C18-4657-BC76-A57678B3776B';
                }
                $url = 'https://api.jizhibao.com.cn/iot/message/v2/elevator/push';
                $list = new SendParam;
                $list->outId = $outDeviceId.time();
                $list->outDeviceId = $outDeviceId;
                $list->transportationNumber = "";
                $list->loadNum = $param['weight'];
                $list->personNum = $param['number'];
                $list->heightNum = $param['height'];
                $list->speed = $param['speed'];
                $list->windSpeed = $param['wind_speed'];
                $list->inclinationX = $param['tilt_x'];
                $list->inclinationY = $param['tilt_y'];
                $list->floor = $param['storey'];
                $list->timestamp = date('Y-m-d H:i:s', time());

                // $list = json_encode($list);
                $send = [
                    "list" => [$list],
                    "appId" => $appId,
                    // "appId" => '1af6f0f0-9467-4397-a395-e7e5eb25fc72',
                    "appSecret" => $appSecret,
                    // "appSecret" => '2156bee1-b7e4-4ccb-b84f-7a6a7dd094d7',
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($send);
                Log::write($send_json, 'ForwardController241');
                Log::write($stringBody, 'ForwardController241');
                break;
            case 240:
                //中房项目-赵磊-升降机
                foreach ($param as $key => $value) {
                    $param[$key] = (float) $value;
                }
                /* 参数 */
                // $host = 'http://36.133.44.231:6002/';
                $host = 'http://ses.ccccltd.cn/iotcore/';
                $api = 'recorddata'; //实时数据
                // $api = 'statusdata'; //设备开机、关机请求
                // $app_key = 'svmhgq6t';
                // $app_secret = '7aoxylnuco6rb8aqyi7im3h4c68v00za7ov3q3etrkdgosz86ac37stt3v';
                $app_key = 'qXeBQfVeBguWONkE';
                $app_secret = 'jJUk5hzhB8MPmwJCfn9ByLZCccKj8QrC';
                $t = time();
                $imei = 'hnzt-' . $param['eid'];
                // $imei = $param['eid'];
                $device_type = 112;

                $signStr = $api . $app_key . $app_secret . $t;
                $strtolower = strtolower($signStr);
                $sign = hash("sha256", $strtolower);
                /* status */
                $statusdata['data'] = [
                    "timestamp" => $t,
                    "status" => 'online', //offline
                    // "status" => 'offline'//offline
                ];
                /* recorddata */
                $generic = new SendParam;
                $generic->wind = $param['wind_speed'];
                $generic->uptime = 0;
                $generic->totalupime = 0;
                $generic->cmd = [];
                $hoist[] = [
                    "label" => "hoist",
                    "weight" => $param['weight'],
                    "height" => $param['height'],
                    "speed" => $param['speed'],
                    "floor" => 0,
                    "brakinglen" => 0,
                    "person" => $param['number'],
                    "limiter" => [
                        [
                            "typestr" => "door",
                            "source" => "door_front",
                            "triggered" => false,
                        ],
                    ],
                ];
                $send = [
                    "version" => "0.1.0",
                    "timestamp" => $t * 1000,
                    "upload" => "data",
                    "generic" => $generic,
                    "hoist" => $hoist,
                ];
                $url = $host . $api . '?' . 'imei=' . $imei . '&device_type=' . $device_type . '&app_key=' . $app_key . '&t=' . $t . '&sign=' . $sign;
                $json = json_encode($send); //实时数据
                $json__statusdata = json_encode($statusdata);//上线
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($url, 'ForwardController240');
                // Log::write($json, 'ForwardController240');
                // Log::write($json__statusdata, 'ForwardController240');
                Log::write($stringBody, 'ForwardController240');
                break;
            case 130:
                //武汉海发-小殷
                $url = 'https://www.e-zoom.cloud';
                $appld = 'd2f6498e057541afb205572498b0bfc4';
                $privateKey = 'MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAmAPml5pCjmsbsWWlKWZJiq+6z+8OkH0rud66a8SKd8Z/sFL+KUvEXJNxjdetscfncS7qAv6Q7Z5HRhFuujsZiwIDAQABAkAVFj1vfDuNS/hMdGAjzQeYkGXmoC+yBVsCbo4HkvzuPkjBGSvyYnSerIbPml3Pu/S4IrWFU3wTAN03Y/ufMaTpAiEA2z4MFsvdlZu+qLSZqfEhKR2Nc9n8DDhOH3rOqx5AJ68CIQCxgHGCFkJsHBCGnQDsr9i21WgjV2q56pfQ1GEB3Y6G5QIgQi41qf/6MHomEHkL1a/TKb0hAPKxUeMBOiFxF1h3V0MCIACr88ICQ44VLRrVTUOYBsHqXNKFain58UkhBJz1MazhAiBzw6j5o9WKkhHt98OAt1IycnZazUZyAo9hn1S3fGZR7w==';
                $api = '/yzt-zhgd/zhgdCraneRecord/saveRecord';
                $time = time() * 1000;
                $aes_data = 'appid=' . $appld . '&systemTime=' . $time . '&uri=' . $api;
                $str = chunk_split($privateKey, 64, PHP_EOL); //在每一个64字符后加一个\n
                $privateKey = "-----BEGIN RSA PRIVATE KEY-----" . PHP_EOL . $str . "-----END RSA PRIVATE KEY-----";
                // 要签名的数据
                $data = $aes_data;
                // 使用 MD5 生成数据的哈希值
                openssl_sign($data, $signMsg, $privateKey, OPENSSL_ALGO_MD5);
                // 将签名进行 Base64 编码，以便安全地存储或传输
                $sign = base64_encode($signMsg);
                $send = [
                    "devsn" => (int) $param['eid'],
                    "makeFactory" => "ty",
                    "time" => date('Y-m-d H:i:s', time()),
                    "scope" => $param['amplitude'],
                    "height" => $param['height'],
                    "rotate" => $param['round'],
                    "oblique" => $param['angle_x'],
                    "ws" => $param['wind_speed'],
                    "rated_weight" => 67.9,
                    "momper" => $param['moment_percent'],
                    "weight" => $param['weight'],
                    "state" => 0,
                ];
                $client = new Client;
                $response = $client->request('POST', $url . $api, [
                    'json' => $send,
                    'headers' => [
                        'appid' => $appld,
                        'systemTime' => $time,
                        'sign' => $sign,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($send);
                Log::write($send_json, 'ForwardController130');
                Log::write($stringBody, 'ForwardController130');
                break;
            case 131:
                $host = 'http://58.211.166.189:8101/';
                if (Cache::has('case_131')) {
                    $token = Cache::get('case_131');
                } else {
                    $api = 'dingsi-auth/oauth/token'; //token
                    $client = new Client;
                    $send =[
                        "grant_type" => "password",
                        "scope" => "all",
                        "username" => "7v3vKnI0GJKAB4tSuG",
                        "password" => "b92589575fdad96a8ed87856c690e9dd",
                    ];
                    $response = $client->request('POST', $host . $api, [
                        'form_params' => $send,
                        'headers' => [
                            'Tenant-Id' => "000000",
                            'Authorization' => "Basic b3BlbmFwaTpkaW5nc2k=",
                        ],
                    ])->getBody();
                    $stringBody = (string) $response;
                    $access_token = json_decode($stringBody)->access_token;
                    Cache::set('case_131', $access_token, 500000);
                }
                $api = 'dingsi-openapi/openapi/tower/sendData'; //实时数据
                $send['methodName'] = "addRecords";
                $send['projectNumber'] = "202307060001";
                $send['id'] = uniqid();
                $send['version'] = "2";
                $send['data'][] = [
                    "towerStatus" => "0",
                    "faceRecognitionStatus" => "0",
                    "deviceSn" => $param['eid'],
                    "rotation" => $param['round'],
                    "weight" => $param['weight'],
                    "height" => $param['height'],
                    "dip" => round($param['angle_x'], 1),
                    "uploadTime" => date('Y-m-d H:i:s', time()),
                    "moment" => round($param['moment'], 1),
                    "momentPercentage" => round($param['moment_percent'], 1),
                    "amplitude" => round($param['amplitude'], 1),
                    "windSpeed" => round($param['wind_speed'], 1),
                    "ratedWeight" => 3,
                    "idCard" => 37030,
                ];
                $client = new Client;
                $response = $client->request('POST', $host . $api, [
                    'json' => $send,
                    'headers' => [
                        'Dingsi-Auth' => 'bearer '.$token,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                Log::write(json_encode($send), 'ForwardController131');
                Log::write($stringBody, 'ForwardController131');
                break;
            case 243:
                $host = 'http://58.211.166.189:8101/';
                if (Cache::has('case_131')) {
                    $token = Cache::get('case_131');
                } else {
                    $api = 'dingsi-auth/oauth/token'; //token
                    $client = new Client;
                    $send =[
                        "grant_type" => "password",
                        "scope" => "all",
                        "username" => "7v3vKnI0GJKAB4tSuG",
                        "password" => "b92589575fdad96a8ed87856c690e9dd",
                    ];
                    $response = $client->request('POST', $host . $api, [
                        'form_params' => $send,
                        'headers' => [
                            'Tenant-Id' => "000000",
                            'Authorization' => "Basic b3BlbmFwaTpkaW5nc2k=",
                        ],
                    ])->getBody();
                    $stringBody = (string) $response;
                    $access_token = json_decode($stringBody)->access_token;
                    Cache::set('case_131', $access_token, 500000);
                }
                $api = 'dingsi-openapi/openapi/lift/sendData'; //升降机实时数据
                $send['methodName'] = "addRecords";
                $send['projectNumber'] = "202307060001";
                $send['id'] = uniqid();
                $send['version'] = "2";
                $send['data'][] = [
                    "deviceSn" => $param['eid'],
                    "uploadTime" => date('Y-m-d H:i:s', time()),
                    "weight" => $param['weight'],
                    "height" => $param['height'],
                    "speed" => $param['speed'],
                    "frontDoorStatus" => $param['front_door_status'],
                    "backDoorStatus" => $param['back_door_status'],
                    "currentCallFloor" => 0,
                    "faceRecognitionStatus" => 0,
                    "dip" => round($param['tilt_x'], 1),
                    "windSpeed" => round($param['wind_speed'], 1),
                    "personNumber" => $param['number'],
                    "safetyHelmetNumber" => 250,
                    "idCard" => 0,
                    "storey" => $param['storey'],
                    "runStatus" => $param['run_status'],
                    "liftStatus" => $param['run_status'],
                ];
                $client = new Client;
                $response = $client->request('POST', $host . $api, [
                    'json' => $send,
                    'headers' => [
                        'Dingsi-Auth' => 'bearer '.$token,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                Log::write(json_encode($send), 'ForwardController243');
                Log::write($stringBody, 'ForwardController243');
                break;
            case 132:
                //小袁-苏州中亿丰
                $url = 'http://183.213.16.8:9002/devCommon/general/api/v2';
                $send['sn'] = (string)$param['eid'];
                $send['msg']['type'] = 'linux_crane_timely';
                unset($param['forward_id'], $param['id'], $param['issued_control'], $param['create_time'], $param["update_time"], $param["other"], $param["remark"]);
                $send['msg']['data'] = $param;
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($send);
                Log::write($send_json, 'ForwardController132');
                Log::write($stringBody, 'ForwardController132');
                break;
            case 242:
                //福建高支模
                $send =$param;
                $url = 'https://nisuosi.com/api/wd/lifter/addLift';
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($send);
                Log::write($send_json, 'ForwardController133');
                Log::write($stringBody, 'ForwardController133');
                break;
            default:
                return 0;
                break;
        }
    }
    public static function alarmForward($param)
    {
        $alarm_array = ['正常', '高度上限预警', '高度上限报警', '幅度近限预警', '幅度近限报警', '幅度远限预警', '幅度远限报警', '重量预警', '重量报警', '力矩预警', '力矩报警', '风速预警', '风速报警', '防碰撞左转预警', '防碰撞左转报警', '防碰撞右转预警', '防碰撞右转报警', '倾角预警', '倾角报警']; //报警数据字典
        switch ($param['forward_id']) {
            case 1001:
                //塔机转老平台数据
                /*
                "eid": 15663,
                "height": 0, //高度
                "range": 0, //幅度
                "rotation_angle": 0, //回转角度
                "lifting_weight": 0, //吊重
                "force": 0, //力距
                "force_distance": 0, //力距百分比
                "wind_speed": 0, //风速
                "magnification": "本机倍率2倍率", //倍率
                "anteversion_x": 0, //倾角X
                "anteversion_y": 0
                 */
                $url = '118.190.60.2/api/v1/hardware/TowerAlarmData';
                $send = [
                    "eid" => $param['eid'],
                    "type" => $alarm_array[$param['alarm_type']],
                    "type_id" => 40,
                    "height" => $param['height'],
                    "lifting_weight" => $param['weight'],
                    "rotation_angle" => $param['round'],
                    "range" => $param['amplitude'],
                    "wind_speed" => $param['wind_speed'],
                    "force" => $param['moment'],
                    "force_distance" => $param['moment_percent'],
                    "anteversion_x" => $param['angle_x'],
                    "anteversion_y" => $param['angle_y'],
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 2001:
                //升降机
                /*
                {
                "eid": 23120455,
                "type": "高度预警", //报警内容
                "type_id": 40, //报警编号
                "height": 12.22, //高度
                "weight": 0.5, //幅度
                "number": 281.60, //回转角度
                "speed": 500, //吊重
                "wind_speed": 1.2, //风速
                "tilt_x": 1.0, //倾角X
                "tilt_y": 1.0
                }
                 */
                $url = '118.190.60.2/api/v1/hardware/addElevatorAlarm';
                $send = [
                    "eid" => $param['eid'],
                    "type" => $alarm_array[$param['type_id']],
                    "type_id" => $param['type_id'],
                    "height" => $param['height'],
                    "weight" => $param['weight'],
                    "number" => $param['number'],
                    "speed" => $param['speed'],
                    "wind_speed" => $param['wind_speed'],
                    "tilt_x" => $param['tilt_x'],
                    "tilt_y" => $param['tilt_y'],
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 201:
                //小张客户-升降机
                $url = 'http://58.34.63.88:2599/deviceDataUpload/upload';
                $data['eid'] = $param['eid'];
                $data['type_id'] = $param['type_id'];
                $data['height'] = $param['height'];
                $data['speed'] = $param['speed'];
                $data['weight'] = $param['weight'];
                $data['load'] = $param['elevator_load'];
                $data['tilt_x'] = $param['tilt_x'];
                $data['tilt_y'] = $param['tilt_y'];
                $data['front_door_status'] = $param['front_door_status'];
                $data['rear_door_status'] = $param['back_door_status'];
                $data['run_status'] = $param['run_status'];
                $data['wind_speed'] = $param['wind_speed'];
                $data['number'] = $param['number'];
                $data['updated_at'] = date('Y-m-d H:i:s', time());
                $send_data = [
                    "deviceType" => "2",
                    "messageType" => "6",
                    "message" => $data,
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send_data,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 215:
                //于-日照客户-tianxi-塔机报警
                $url = 'http://rizhaotianxi.qd27.com/api/tower_warn';
                $code = 'M007';
                $time = time();
                $token = 'M00720221227T';
                $sign = md5($token . $time);
                $send['code'] = $code;
                $send['sign'] = $sign;
                $send['time'] = $time;
                $send['data'] = [
                    "equipment_no" => $param['eid'],
                    "type_id" => $param['alarm_type'],
                    "height" => $param['height'],
                    "range" => $param['amplitude'],
                    "rotation" => $param['round'],
                    "liftingweight" => $param['weight'],
                    "force" => $param['moment'],
                    "forcedistance" => $param['moment_percent'],
                    "windspeed" => $param['wind_speed'],
                    "magnification" => $param['override'],
                    "tiltX" => $param['angle_x'],
                    "tiltY" => $param['angle_y'],
                    "pushtime" => date('Y/m/d H:i', time()),
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 216:
                //于-日照客户-tianxi-升降机-报警
                $url = 'http://rizhaotianxi.qd27.com/api/lifter_warn';
                $code = 'M007';
                $time = time();
                $token = 'M00720221227T';
                $sign = md5($token . $time);
                $send['code'] = $code;
                $send['sign'] = $sign;
                $send['time'] = $time;
                $send['data'] = [
                    "equipment_no" => $param['eid'],
                    "height" => $param['height'],
                    "speed" => $param['speed'],
                    "weight" => $param['weight'],
                    "load" => $param['elevator_load'],
                    "number" => $param['number'],
                    "tilt_x" => $param['tilt_x'],
                    "tilt_y" => $param['tilt_y'],
                    "front_door_status" => $param['front_door_status'],
                    "rear_door_status" => $param['back_door_status'],
                    "run_status" => $param['run_status'],
                    "warn_type" => $param['type_id'],
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                return 1;
                break;
            case 107:
                //赵磊--青岛易建智慧
                $url = 'http://221.0.183.26:9880/api/ty/tower/alarm';
                $send_json = json_encode($param);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $param,
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($stringBody, 'ForwardController108');
                break;
            case 221:
                //赵磊--青岛易建智慧
                $url = 'http://221.0.183.26:9880/api/ty/elevator/alarm';
                $send_json = json_encode($param);
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $param,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($stringBody, 'ForwardController221');
                break;
            case 222:
                //黄冈工程建设监管平台-升降机预警数据上传接口
                /*
                hgctlljy         hgctlljy123
                 */
                $url = '122.189.98.132:8012/smart-gvp/api/v1/reportDeviceLift/violation';
                $token = '7c3f061d-0091-46cd-b06a-fdd0e5315831';
                $send['token'] = $token;
                $send['body'][] = [
                    "craneNum" => (string) $param['eid'],
                    "time" => date('Y-m-d H:i:s', time()),
                    "information" => '载重预警',
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($send, 'ForwardController222');
                Log::write($stringBody, 'ForwardController222');
                return 1;
                break;
            case 112:
                //小袁--苏州客户 筑安
                $url = 'http://material-api.huariot.com/';
                $key = 'sdtanyue001';
                $secret = '351E477205994EF48606B0E5475CE4E0';
                $getTokenUrl = 'api-gateway/api/third/v1/auth/login/';
                $token_url = $url . $getTokenUrl . '?' . 'key=' . $key . '&secret=' . $secret;
                $client = new Client;
                $response = $client->request('GET', $token_url)->getBody();
                $stringBody = json_decode((string) $response);
                $accessToken = $stringBody->data->accessToken;
                /* 设备上线 */
                $id = $param['other'];
                /* 实时数据添加 */
                $dataUrl = $url . 'device-socket/api/v1/third/tower-crane/warning-start/';
                $send = [
                    "id" => $id,
                    "collection_time" => time() * 1000,
                    "warning_level" => 2,
                    "description" => $alarm_array[$param['alarm_type']],
                    "source_from" => 'sdty',
                ];
                $send_json = json_encode($send);
                $client = new Client;
                $response = $client->request('POST', $dataUrl, [
                    'json' => $send,
                    'headers' => [
                        'Authorization' => 'Bearer ' . $accessToken,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($send_json, 'ForwardController112');
                // Log::write($stringBody, 'ForwardController112');
                break;
            case 120:
                //福建测试
                $url = '101.133.149.245:9999/api/v1/hardware/TowerAlarmData';
                unset($param['forward_id'], $param['id'], $param['issued_control'], $param['create_time'], $param["update_time"], $param["other"], $param["remark"]);
                $client = new Client;
                $param['eid'] = (int) $param['eid'];
                $param['alarm_type'] = (int) $param['alarm_type'];
                $response = $client->request('POST', $url, [
                    'json' => $param,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($param, 'ForwardController_120');
                Log::write($stringBody, 'ForwardController_120');
                break;
            case 236:
                //福建测试
                $url = '101.133.149.245:9999/wd/lifter/addLiftAlarm';
                unset($param['forward_id'], $param['id'], $param['issued_control'], $param['create_time'], $param["update_time"], $param["other"], $param["remark"]);
                $client = new Client;
                $param['eid'] = (int) $param['eid'];
                $param['type_id'] = (int) $param['type_id'];
                $response = $client->request('POST', $url, [
                    'json' => $param,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($param, 'ForwardController_236');
                Log::write($stringBody, 'ForwardController_236');
                break;
            case 110:
                //殷平辉-烟台
                $url = 'https://api.tongzhuwang.com/tss/towercrane/safetyTcAlarmRecord/add';
                $token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2ODk5MjUwNDYsInVzZXJuYW1lIjoiYXBpIn0.ecFEh3qazAh738ZwpbpkNMQZ4SPqzndJjwICFtMOGu8';
                /*
                 */
                $send = [
                    "alarmDesc" => $alarm_array[$param['alarm_type']],
                    "alarmType" => $param['alarm_type'],
                    "alarmTime" => date('Y-m-d H:i:s', time()),
                    "deadWeight" => $param['weight'],
                    "dip" => $param['angle_x'],
                    "equipmentName" => $param['eid'],
                    "equipmentNumber" => (int) $param['eid'],
                    "extent" => $param['amplitude'],
                    "height" => $param['height'],
                    "moment" => $param['moment_percent'],
                    "windSpeed" => $param['wind_speed'],
                    "tenantId" => 24,
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                    'headers' => [
                        'X-Access-Token' => $token,
                    ],
                ])->getBody();
                $send_json = json_encode($send);
                $stringBody = (string) $response;
                Log::write($send_json, 'ForwardController110');
                Log::write($stringBody, 'ForwardController110');
                break;
            case 237:
                //安固士&探越塔吊升降机技术交流
                $url = 'https://openapi.anculsai.com:8004/open/api/v1/fse/lift/anon/tanyue/warnData';
                unset($param['forward_id'], $param['id'], $param['issued_control'], $param['create_time'], $param["update_time"], $param["other"], $param["remark"]);
                $client = new Client;
                $param['eid'] = (int) $param['eid'];
                $param['type_id'] = (int) $param['type_id'];
                $response = $client->request('POST', $url, [
                    'json' => $param,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($param, 'ForwardController_237');
                Log::write($stringBody, 'ForwardController_237');
                break;
            case 122:
                //合木
                $url = 'https://zhcs.zhnbxc.top:18090/admin-api/system/api/tower/alarm';
                $send = [
                    "eid" => $param['eid'],
                    "height" => $param['height'],
                    "weight" => $param['weight'],
                    "round" => $param['round'],
                    "amplitude" => $param['amplitude'],
                    "windSpeed" => $param['wind_speed'],
                    "moment" => $param['amplitude'] * $param['weight'],
                    "momentPercent" => $param['moment_percent'],
                    "override" => $param['override'],
                    "angleX" => $param['angle_x'],
                    "angleY" => $param['angle_y'],
                    "alarmType" => $param['alarm_type'],
                ];
                $client = new Client;
                $send['eid'] = (int) $param['eid'];
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                Log::write($send, 'ForwardController_122');
                Log::write($stringBody, 'ForwardController_122');
                break;
            case 115:
                $data = $param;
                $need_array = [13, 14, 15, 16];
                if (!in_array($data["alarm_type"], $need_array)) {
                    break;
                }
                //江苏麦科斯
                if (Cache::has('CASE_115')) {
                    $token = Cache::get('CASE_115');
                } else {
                    $token_body = [
                        "username" => "zhongxiangshebei",
                        "password" => "max20231007",
                    ];

                    $client = new Client;
                    $response = $client->request('POST', 'http://119.3.93.77:7308/center/users/login', [
                        'json' => $token_body,
                    ])->getBody();
                    $stringBody = (string) $response;
                    $token = json_decode($stringBody)->data->token;
                    Cache::set('CASE_115', $token, 14400);
                }
                $url = 'http://119.3.93.77:7308/device-server/dataReceive/getTowerData';
                $send = [
                    "deviceNo" => (int) $data['eid'],
                    "brand" => '5',
                    "load" => (string) $data['weight'],
                    "radius" => (string) $data['amplitude'],
                    "percent" => (string) $data['moment_percent'],
                    "angle" => (string) $data['round'],
                    "height" => (string) $data['height'],
                    "windSpeed" => (string) $data['wind_speed'],
                    "safeLoad" => '5.0',
                    "fall" => "2",
                    "obliqueDirection" => '1',
                    "obliqueAngle" => (string) $data['angle_x'],
                    "deviceTime" => date('Y-m-d H:i:s', time()),
                    "createTime" => date('Y-m-d H:i:s', time()),
                    "idCard" => '0',
                    "obliqueState" => 0,
                    "isCollisionAlarm" => (int) $data["alarm_type"],
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                    'headers' => [
                        'token' => $token,
                    ],
                ])->getBody();
                $stringBody = (string) $response;
                // Log::write($send, 'ForwardController115');
                // Log::write($stringBody, 'ForwardController115');
                break;
            case 125:
                //江西飞达
                $url = 'https://www.zhudayun.cn/app-api/outapi/warning';
                switch ($param['alarm_type']) {
                    case 1:
                    case 2:
                        $warningCode = 12;
                        break;
                    case 3:
                    case 4:
                    case 5:
                    case 6:
                        $warningCode = 11;
                        break;
                    case 7:
                    case 8:
                        $warningCode = 20;
                        break;
                    case 9:
                    case 10:
                        $warningCode = 16;
                        break;
                    case 11:
                    case 12:
                        $warningCode = 13;
                        break;
                    case 13:
                    case 14:
                    case 15:
                    case 16:
                        $warningCode = 17;
                        break;
                    default:
                        return 0;
                        break;
                }
                $warningMsg = [
                    5 => '重量限制功能失效',
                    6 => '力矩限制功能失效',
                    7 => '幅度限制功能失效',
                    8 => '高度限制功能失效',
                    9 => '回转限制功能失效',
                    11 => '幅度预警',
                    12 => '高度预警',
                    13 => '风速超四级预警',
                    14 => '回转预警',
                    16 => '超力矩110%预警',
                    17 => '防碰撞预警',
                    20 => '超重105%违规',
                    21 => '超力矩违规',
                ];

                $send = [
                    "terminalNumber" => 'TY' . $param['eid'],
                    "time" => date('Y-m-d H:i:s', time()),
                    "endTime" => date('Y-m-d H:i:s', time()),
                    "warningCode" => $warningCode,
                    "warningMsg" => $warningMsg[$warningCode],
                    "hours" => 0,
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($send);
                // Log::write($send_json, 'ForwardController125');
                // Log::write($stringBody, 'ForwardController125');
                break;
            case 126:
                foreach ($param as $key => $value) {
                    $param[$key] = (float) $value;
                }
                /* 中房项目设备监控系统 */
                $host = 'http://36.133.44.231:6002/';
                $api = 'v2/alarmdata'; //recorddata
                $app_key = 'svmhgq6t';
                $app_secret = '7aoxylnuco6rb8aqyi7im3h4c68v00za7ov3q3etrkdgosz86ac37stt3v';
                $t = time();
                $imei = 'hnzt-' . $param['eid'];
                $device_type = 96;

                $signStr = $api . $app_key . $app_secret . $t;
                $strtolower = strtolower($signStr);
                $sign = hash("sha256", $strtolower);

                /* alarmdata */
                /* 3高度 6幅度 8风速 50重量 */
                switch ($param['alarm_type']) {
                    case 1:
                    case 2:
                        $detail = 'high';
                        $source = 'hoist.height';
                        $kind = "limiter";
                        $value = $param['height'] . 'm';
                        break;
                    case 11:
                    case 12:
                        $detail = 'wind';
                        $source = 'generic.wind';
                        $kind = 'threshold';
                        $value = $param['wind_speed'] . 'm/s';
                        break;
                    case 7:
                    case 8:
                        $detail = 'weight';
                        $source = 'hoist.weight';
                        $kind = 'limiter';
                        $value = $param['weight'] . 'kg';
                        break;
                    default:
                        return 0;
                        break;
                }
                $alarm[0] = [
                    "detail" => $detail,
                    "source" => $source,
                    "kind" => $kind,
                    "level" => 50,
                    "value" => (string) $value,
                    "triggered" => true,
                ];
                $alarmdata = [
                    "version" => "0.1.0",
                    "timestamp" => $t * 1000,
                    "upload" => "alarm",
                    "alarm" => $alarm,
                ];
                $url = $host . $api . '?' . 'imei=' . $imei . '&device_type=' . $device_type . '&app_key=' . $app_key . '&t=' . $t . '&sign=' . $sign;
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $alarmdata,
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($alarmdata);
                Log::write($send_json, 'ForwardController126');
                Log::write($stringBody, 'ForwardController126');
                break;
            case 127:
                $token = Cache::get('CASE_127');
                //雄安滦雄科技
                $url = 'https://api.xagongdi.com/api/open/crane/save';
                $send = [
                    "token" => $token,
                    "serial" => $param['eid'],
                    "time" => date('Y-m-d H:i:s', time()),
                    "alarm" => $alarm_array[$param['alarm_type']],
                    "amplitude" => $param['amplitude'],
                    "angleX" => $param['angle_x'],
                    "angleY" => $param['angle_y'],
                    "heavy" => $param['weight'],
                    "heavyRatio" => $param['moment_percent'],
                    "height" => $param['height'],
                    "rotary" => $param['round'],
                    "torque" => $param['moment'],
                    "torqueRatio" => $param['moment_percent'],
                    "sp" => $param['wind_speed'],
                    "powerStatus" => "",
                    "driverCard" => "",
                ];
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($send);
                Log::write($send_json, 'ForwardController127');
                Log::write($stringBody, 'ForwardController127');
                break;
            case 132:
                //小袁-苏州中亿丰
                $url = 'http://183.213.16.8:9002/devCommon/general/api/v2';
                $send['sn'] = (string)$param['eid'];
                $send['msg']['type'] = 'linux_crane_warning';
                unset($param['forward_id'], $param['id'], $param['issued_control'], $param['create_time'], $param["update_time"], $param["other"], $param["remark"]);
                $send['msg']['data'] = $param;
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($send);
                Log::write($send_json, 'ForwardController132');
                Log::write($stringBody, 'ForwardController132');
                break;
            case 242:
                //福建高支模
                $send =$param;
                $url = 'https://nisuosi.com/api/wd/lifter/addLiftAlarm';
                $client = new Client;
                $response = $client->request('POST', $url, [
                    'json' => $send,
                ])->getBody();
                $stringBody = (string) $response;
                $send_json = json_encode($send);
                Log::write($send_json, 'ForwardController242');
                Log::write($stringBody, 'ForwardController242');
                break;
            default:
                return 0;
                break;
        }
    }
    //湖北升思科技转发
    public function sskjAuto(Request $request)
    {
        $url = 'http://sdtanyue.com/api/v1/hardware/sskjAuto';
        $eid = trim($request->param('eid'));
        $ecode = trim($request->param('ecode'));
        $vcode = trim($request->param('vcode'));
        $pcode = trim($request->param('pcode'));
        $client = new Client;
        $response = $client->request('POST', $url, ['json' => ['eid' => $eid]])->getBody()->getContents();
        if ($response == -1) {
            return success(null, '该设备不存在');
        }

        $TowerCraneNdata = TowerCraneNdata::where('eid', $eid)->find();
        if (!$TowerCraneNdata) {
            $TowerCraneNdata = new TowerCraneNdata;
        }
        $TowerCraneNdata->eid = $eid;
        $TowerCraneNdata->forward_id = 206;
        $TowerCraneNdata->other = $ecode . ',' . $vcode . ',' . $pcode;
        $rq = $TowerCraneNdata->save();

        $param['设备ID'] = $eid;
        $param['设备登记使用编号'] = $ecode;
        $param['验证码'] = $vcode;
        $param['供应商编号'] = $pcode;
        if ($rq) {
            return success($param, '提交成功');
        } else {
            return success($param, '提交失败,未知问题,请联系技术');
        }
    }
    //湖北升思科技转发T104
    public function sskjAuto_T104(Request $request)
    {
        $eid = trim($request->param('eid'));
        $ecode = trim($request->param('ecode'));
        $vcode = trim($request->param('vcode'));
        $pcode = trim($request->param('pcode'));
        $TowerCraneNdata = TowerCraneNdata::where('eid', $eid)->find();
        if (!$TowerCraneNdata) {
            $TowerCraneNdata = new TowerCraneNdata;
        }
        $TowerCraneNdata->eid = $eid;
        $TowerCraneNdata->forward_id = 206;
        $TowerCraneNdata->other = $ecode . ',' . $vcode . ',' . $pcode;
        $rq = $TowerCraneNdata->save();

        $param['设备ID'] = $eid;
        $param['设备登记使用编号'] = $ecode;
        $param['验证码'] = $vcode;
        $param['供应商编号'] = $pcode;
        if ($rq) {
            return success($param, '提交成功');
        } else {
            return success($param, '提交失败,未知问题,请联系技术');
        }
    }
    //湖北升思科技转发S103
    public function sskjAuto_S103(Request $request)
    {
        $eid = trim($request->param('eid'));
        $ecode = trim($request->param('ecode'));
        $vcode = trim($request->param('vcode'));
        $pcode = trim($request->param('pcode'));
        $ElevatorNdata = ElevatorNdata::where('eid', $eid)->find();
        if (!$ElevatorNdata) {
            $ElevatorNdata = new ElevatorNdata;
        }
        $ElevatorNdata->eid = $eid;
        $ElevatorNdata->forward_id = 218;
        $ElevatorNdata->other = $ecode . ',' . $vcode . ',' . $pcode;
        $rq = $ElevatorNdata->save();

        $param['设备ID'] = $eid;
        $param['设备登记使用编号'] = $ecode;
        $param['验证码'] = $vcode;
        $param['供应商编号'] = $pcode;
        if ($rq) {
            return success($param, '提交成功');
        } else {
            return success($param, '提交失败,未知问题,请联系技术');
        }
    }
    //江苏科盛轩逸--升降机设备添加
    public function jsksxy_sjj(Request $request)
    {
        $eid = trim($request->param('eid'));
        $param['设备ID'] = $eid;
        $ElevatorNdata = ElevatorNdata::where('eid', $eid)->find();
        if (!$ElevatorNdata) {
            return success($param, '设备不在线');
        }
        $ElevatorNdata->forward_id = 231;
        $rq = $ElevatorNdata->save();

        if ($rq) {
            return success($param, '提交成功,设备已添加');
        } else {
            return success($param, '提交失败,未知问题,请联系技术');
        }
    }

}
class SendParam
{

}
